I have a suggestion for an API, how about a keyword argument to 
"abstractmethod" that allows to set the abstract method as "optional" meaning 
that sub-implementations can either implement their own version or use the 
ABC's own, infact, I think the STDLIB could use this itself (I haven't looked 
at the stdlib entirely).

For native code, a new method flag would be required, probably something like 
"OPTIONAL_ABSTRACT" (I forget the naming convention for flags)

example: @abstractmethod(True) # Method won't be included in required 
implementations. Default: False (for bcompat reasons)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/DPQAXKN2NSZYFTEHAGEXHWCTPSDWD4B4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to