A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-June/144858.html below:

[Python-Dev] Proper way to specify that a method is not defined for a type

[Python-Dev] Proper way to specify that a method is not defined for a type [Python-Dev] Proper way to specify that a method is not defined for a typeEthan Furman ethan at stoneleaf.us
Tue Jun 7 13:37:58 EDT 2016
For binary methods, such as __add__, either do not implement or return 
NotImplemented if the other operand/class is not supported.

For non-binary methods, simply do not define.

Except for subclasses when the super-class defines __hash__ and the 
subclass is not hashable -- then set __hash__ to None.

Question:

Are there any other methods that should be set to None to tell the 
run-time that the method is not supported?  Or is this a general 
mechanism for subclasses to declare any method is unsupported?

--
~Ethan~
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4