This video shows the difference between object equality (==) and object identity (is) and when to use one or the other.
C H A P T E R S
0:33 Comparing equality and identity
1:20 Difference between integers and custom classes
1:28 Object equality
1:56 Implement dunder equals (__eq__) to support equality comparison in your class
2:19 Identity check
3:09 The object identity is read-only
3:30 Singletons and identity
4:45 When to compare equality and when to compare identity
4:47 Edge cases
M Y O N L I N E T R A I N I N G
🎓Like my style of teaching? Try free chapters of my online courses: https://pythonforeveryone.com
L I N K S I N T H E V I D E O
Sorting algorithm in Python: https://en.wikipedia.org/wiki/Timsort
#pythonforeveryone #programming #python
Смотрите видео == or is? Object EQUALITY and IDENTITY in Python онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Python for Everyone 30 Апрель 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 747 раз и оно понравилось 32 посетителям.