ABC with abstractmethod: kwargs on Base, explicit names on implementation

Peter Otten __peter__ at web.de
Thu Aug 27 03:28:30 EDT 2020


Samuel Marks wrote:

> The main thing I want is type safety. I want Python to complain if the
> callee uses the wrong argument types, and to provide suggestions on
> what's needed and info about it.
> 
> Without a base class I can just have docstrings and type annotations
> to achieve that.
> 
> What can I use that will require all implementers to have a minimum of
> the same properties and arguments, but also allow them to add new
> properties and arguments?

The clean way would be to give the variants with a different signature a 
different name.




More information about the Python-list mailing list