Telegram Group & Telegram Channel
Разница между == и is

Многие разработчики не понимают разницу этих двух операторов сравнения. Из-за неправильного использования == и is в приложениях могут возникнуть странные ошибки.

Оператор == проверяет равенство значений двух объектов. А оператор is проверяет идентичность самих объектов. Его используют, чтобы удостовериться, что переменные указывают на один и тот же объект в памяти.

Но Python в целях производительности кеширует малые числа и короткие строки, поэтому возможны некоторые казусы, как в примере выше.

#тонкости



tg-me.com/python_academy/426
Create:
Last Update:

Разница между == и is

Многие разработчики не понимают разницу этих двух операторов сравнения. Из-за неправильного использования == и is в приложениях могут возникнуть странные ошибки.

Оператор == проверяет равенство значений двух объектов. А оператор is проверяет идентичность самих объектов. Его используют, чтобы удостовериться, что переменные указывают на один и тот же объект в памяти.

Но Python в целях производительности кеширует малые числа и короткие строки, поэтому возможны некоторые казусы, как в примере выше.

#тонкости

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/426

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

Python Academy from us


Telegram Python Academy
FROM USA