This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rrt
Recipients docs@python, rrt
Date 2019-05-27.06:03:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
By changing one line of AutoNumber:

    def __new__(cls):


    def __new__(cls, *args):

Enums derived from AutoNumber can now support constructors that take named arguments; for example:

class Color(AutoNumber):
    def __init__(self, pantone=None):
        self.pantone = pantone or 'unknown'

class Swatch(Color):
    AUBURN = ('3497')
    SEA_GREEN = ('1246')
    BLEACHED_CORAL = () # New color, no Pantone code yet!

Without the change, one gets the error:

TypeError: __new__() takes 1 positional argument but 2 were given

I attach runnable demonstration code.
Date User Action Args
2019-05-27 06:03:00rrtsetrecipients: + rrt, docs@python
2019-05-27 06:03:00rrtsetmessageid: <>
2019-05-27 06:03:00rrtlinkissue37062 messages
2019-05-27 06:03:00rrtcreate