EnumType __call__ method description does not match the implementation
Aperta
@ethanfurman ci sta già lavorando.
Dal 17/5/2024.
docs
stdlib
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 36k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Documentation
See EnumType.call documentation, where the prototype is:
__call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
While in the enum.py source code there is:
def __call__(cls, value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None):
-
The
_not_givenhelper behaves differently thanNone, which even breaks compatibility with previous versions (this change was introduced in 3.12.3), when one needs to do some customization of enum metaclass.- e.g. as propsed on the stack overflow to implement enum item deprecation warning - note that this implementation stops working in 3.12.3 since the call of the parent
EnumType.__call__passesNoneinstead of_not_givenand it causes different behavior.
- e.g. as propsed on the stack overflow to implement enum item deprecation warning - note that this implementation stops working in 3.12.3 since the call of the parent
-
Note
*vs.*values, which I believe even behaves differently.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.