Guido van Rossum wrote:
We could also consider this a general weakness of the "alternative constructors are class methods" pattern. If instead these alternative constructors were folded into the main constructor (e.g. via special keyword args) it would be altogether clearer what a subclass should do.

A useful guideline might be that class methods can be provided
as sugar for alternative constructors, but they should all
funnel through the main constructor.

There's a convention like this in the Objective-C world where
one of an object's "init" methods is supposed to be documented
as the "designated initialiser", so that there is just one
thing that subclasses need to override.

--
Greg


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to