[Tutor] What are the benefits of template or abstract base classes?

Peter Otten __peter__ at web.de
Mon Jun 8 08:51:27 EDT 2020


boB Stepp wrote:

> Now in "4.2 Inheritance" at
> https://dabeaz-course.github.io/practical-python/Notes/04_Classes_objects/02_Inheritance.html
> 
> class TableFormatter:
>      def headings(self, headers):
>          '''
>          Emit the table headings.
>          '''
>          raise NotImplementedError()
> 
>      def row(self, rowdata):
>          '''
>          Emit a single row of table data.
>          '''
>          raise NotImplementedError()
> 
> with the comment:
> 
> "This class does nothing

> What are your thoughts?

Dunno. Maybe writing code that does nothing is an art form, like poems or 
songs... and mypy is your arbiter elegantiarum. 




More information about the Tutor mailing list