[Python-Dev] Return type of alternative constructors
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun May 8 20:55:09 EDT 2016
More information about the Python-Dev mailing list
Sun May 8 20:55:09 EDT 2016
- Previous message (by thread): [Python-Dev] Return type of alternative constructors
- Next message (by thread): [Python-Dev] Return type of alternative constructors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): [Python-Dev] Return type of alternative constructors
- Next message (by thread): [Python-Dev] Return type of alternative constructors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list