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

boB Stepp robertvstepp at gmail.com
Mon Jun 8 14:10:21 EDT 2020


On Mon, Jun 8, 2020 at 7:52 AM Peter Otten <__peter__ at web.de> wrote:
>
> 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.

Totally unexpected, quirky response!  Who shall reign supreme in
directing my cyber-court: Black, MyPy or Pylint?  Pylint critiques
seemingly every choice, but will back down if challenged.  MyPy only
judges a subset of cyberlife.  And Black judges with an iron hand.
Perhaps off with him to the Coliseum fights to perish unless further
deemed worthy?
~(:>))

-- 
boB


More information about the Tutor mailing list