Identifikatsiya operatorlari ma'lumotlarning xotira birligini aniqlash uchun ishlatiladi.
Xotira... Python xotirani hisobga olmaydi deyishadiku? CPython ob'ektlari xotirani boshqarishni optimallashtirish uchun juda ko'p xotiradan foydalanadi.Bunga misol CPython -5 dan 256 gacha bo'lgan barcha butun sonlarning global ro'yxatini saqlaydi va bularning hammasi uchun 266 * 24 = 6384 baytni oldindan ajratadi.
Ma'lumotlar turi nima u? Ma'lumotlar turiga namunalar: str satr 'salom' int butun sonlar 2 float haqiqiy sonlar 2.03 bool mantiqiy True yoki False
a = 28 b = 19 a va b o'zgaruvchi 28 va 19 ma'lumot ma'lumot turi int
a va b o'zgaruvchilar ma'lumot turi bir xil lekin xotirada joylashuvi farq qilishi mumkin. Ma'lumot xotirada joylashishini ko'rish uchun id() funktsiyasidan foydalanamiz.
is - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lsa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is b) False print(True is False) False print(False is False) True print(True is True) True
is not - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lmasa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi print(a is not b) True a = 5 b = 5 print(a is not b) False
Identifikatsiya operatorlari ma'lumotlarning xotira birligini aniqlash uchun ishlatiladi.
Xotira... Python xotirani hisobga olmaydi deyishadiku? CPython ob'ektlari xotirani boshqarishni optimallashtirish uchun juda ko'p xotiradan foydalanadi.Bunga misol CPython -5 dan 256 gacha bo'lgan barcha butun sonlarning global ro'yxatini saqlaydi va bularning hammasi uchun 266 * 24 = 6384 baytni oldindan ajratadi.
Ma'lumotlar turi nima u? Ma'lumotlar turiga namunalar: str satr 'salom' int butun sonlar 2 float haqiqiy sonlar 2.03 bool mantiqiy True yoki False
a = 28 b = 19 a va b o'zgaruvchi 28 va 19 ma'lumot ma'lumot turi int
a va b o'zgaruvchilar ma'lumot turi bir xil lekin xotirada joylashuvi farq qilishi mumkin. Ma'lumot xotirada joylashishini ko'rish uchun id() funktsiyasidan foydalanamiz.
is - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lsa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi
print(a is b) False print(True is False) False print(False is False) True print(True is True) True
is not - Agar ikkala o'zgaruvchi bir xil ob'ekt bo'lmasa rost (True) qaytaradi, boshqa holatda yolg'on (False) qaytaradi print(a is not b) True a = 5 b = 5 print(a is not b) False
However, analysts are positive on the stock now. “We have seen a huge downside movement in the stock due to the central electricity regulatory commission’s (CERC) order that seems to be negative from 2014-15 onwards but we cannot take a linear negative view on the stock and further downside movement on the stock is unlikely. Currently stock is underpriced. Investors can bet on it for a longer horizon," said Vivek Gupta, director research at CapitalVia Global Research.
Telegram auto-delete message, expiring invites, and more
elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.