My screencast on Python's special NotImplemented value is now public. Screencast...

@treyhunner@mastodon.social

My screencast on Python's special NotImplemented value is now public.

Screencast: youtu.be/wI4K7faxZ_Q

Article: pym.dev/when-to-use-notimpleme

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

#Python