مشغلي هوية بايثون
مشغلي هوية بايثون
تُستخدم عوامل الهوية لمقارنة الكائنات ، ليس إذا كانت متساوية ، ولكن إذا كانت في الواقع نفس الكائن ، مع نفس موقع الذاكرة:
Operator | Description | Example | Try it |
---|---|---|---|
is | Returns true if both variables are the same object | x is y | |
is not | Returns true if both variables are not the same object | x is not y |