[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-10-05 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e8165e79f57cb3ca60bf031c417f8fd20c99eaa2 by Łukasz Langa (Miss 
Islington (bot)) in branch '3.9':
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370)
https://github.com/python/cpython/commit/e8165e79f57cb3ca60bf031c417f8fd20c99eaa2


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 64362c2e435eddc5e84cea313d92bc0b96d227f7 by Miss Islington (bot) 
in branch '3.9':
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370)
https://github.com/python/cpython/commit/64362c2e435eddc5e84cea313d92bc0b96d227f7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:

Thank you, Reuben!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 5acc1b5f0b62eef3258e4bc31eba3b9c659108c9 by Miss Islington (bot) 
in branch '3.8':
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22369)
https://github.com/python/cpython/commit/5acc1b5f0b62eef3258e4bc31eba3b9c659108c9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21410
pull_request: https://github.com/python/cpython/pull/22370

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +21409
pull_request: https://github.com/python/cpython/pull/22369

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-21 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +21388
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22349

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-21 Thread Reuben Thomas


Reuben Thomas  added the comment:

That's the one I was thinking of: the example in the docs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-09-21 Thread Ethan Furman


Ethan Furman  added the comment:

The only `AutoNumber` in the stdlib is as an example in the docs.  Were you 
thinking of something else?

--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-03-25 Thread Ethan Furman


Change by Ethan Furman :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2020-03-25 Thread Ethan Furman


Change by Ethan Furman :


--
assignee: docs@python -> ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2019-05-27 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2019-05-27 Thread Reuben Thomas


Reuben Thomas  added the comment:

Just to be clear, the proposed change to the documentation is simply to add ", 
*args" to the argument list of AutoNumber.__new__.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37062] `AutoNumber` class in enum documentation: support *args in constructor

2019-05-27 Thread Reuben Thomas


New submission from Reuben Thomas :

By changing one line of AutoNumber:

def __new__(cls):

to

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.

--
assignee: docs@python
components: Documentation
files: foo.py
messages: 343607
nosy: docs@python, rrt
priority: normal
severity: normal
status: open
title: `AutoNumber` class in enum documentation: support *args in constructor
versions: Python 3.8
Added file: https://bugs.python.org/file48365/foo.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com