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.

classification
Title: ENUM TypeError using mixing
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: benyamin621, ethan.furman
Priority: normal Keywords:

Created on 2022-03-24 13:43 by benyamin621, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg415942 - (view) Author: Benyamin Guedj (benyamin621) Date: 2022-03-24 13:43
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-04-11 14:59:57adminsetgithub: 91267
2022-03-24 14:49:14ethan.furmansetnosy: + ethan.furman
2022-03-24 13:43:49benyamin621create