On Thu, Oct 1, 2020 at 7:51 AM William Pickard <lollol222gg@gmail.com> wrote:
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)

That's already possible: just don't use @abstractmethod at all. You can still override!

--
--Guido van Rossum (python.org/~guido)