1 Oct
2020
1 Oct
'20
10:50 a.m.
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)