[issue47111] ENUM TypeError using mixing

2022-03-24 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue47111] ENUM TypeError using mixing

2022-03-24 Thread Benyamin Guedj


New submission from Benyamin Guedj :

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 "", line 1, in 
  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: [, ]


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

--
components: Library (Lib)
messages: 415942
nosy: benyamin621
priority: normal
severity: normal
status: open
title: ENUM TypeError using mixing
type: crash
versions: Python 3.8

___
Python tracker 

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