My screencast on Python's special NotImplemented value is now public. Screencast...
Trey Hunner 🐍 @treyhunner@mastodon.social
My screencast on Python's special NotImplemented value is now public.
Screencast: https://youtu.be/wI4K7faxZ_Q
Article: https://pym.dev/when-to-use-notimplemented/
NotImplemented is something you'll want to know if you ever implement __eq__ or various other "operate on another object"-style dunder methods.
This:
>>> 2 == 2.0
True
Isn't the same as:
>>> (2).__eq__(2.0)
NotImplemented