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 benyamin621
Recipients benyamin621
Date 2022-03-24.13:43:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648129429.6.0.678446236905.issue47111@roundup.psfhosted.org>
In-reply-to
Content
when trying to implement mixing with enum

```python
from typing import Tuple
from enum import Enum
class Blah(Tuple[str, ...], Enum):
    val = ('a', 'b')
```


>>> from typing import Tuple
>>> from enum import Enum
>>> class Blah(Tuple[str, ...], Enum):
...     val = ('a', 'b')
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 150, in __prepare__
    member_type, first_enum = metacls._get_mixins_(cls, bases)
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 574, in _get_mixins_
    member_type = _find_data_type(bases) or object
  File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\enum.py", line 562, in _find_data_type
    raise TypeError('%r: too many data types: %r' % (class_name, data_types))
TypeError: 'Blah': too many data types: [<class 'tuple'>, <class 'typing.Generic'>]


note:
  the same code work on python 3.7, 3.9, 3.10



I have checked the source code of enum of 3.8

https://github.com/python/cpython/blob/3.8/Lib/enum.py

and it's not the same as the other version 

https://github.com/python/cpython/blob/3.9/Lib/enum.py
History
Date User Action Args
2022-03-24 13:43:49benyamin621setrecipients: + benyamin621
2022-03-24 13:43:49benyamin621setmessageid: <1648129429.6.0.678446236905.issue47111@roundup.psfhosted.org>
2022-03-24 13:43:49benyamin621linkissue47111 messages
2022-03-24 13:43:49benyamin621create