Message319766
See issue 33880 for the same issue with namedtuple.
This shows up on dataclasses only through make_dataclass. This is an expected ValueError:
>>> make_dataclass('a', ['a', 'b', 'c', 'a'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 1123, in make_dataclass
raise TypeError(f'Field name duplicated: {name!r}')
TypeError: Field name duplicated: 'a'
But this is a SyntaxError:
>>> make_dataclass('a', ['\u00b5', '\u03bc'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 1133, in make_dataclass
unsafe_hash=unsafe_hash, frozen=frozen)
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 958, in dataclass
return wrap(_cls)
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 950, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 871, in _process_class
else 'self',
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 490, in _init_fn
return_type=None)
File "/cygdrive/c/home/eric/.local/lib/python3.6/site-packages/dataclasses.py", line 356, in _create_fn
exec(txt, globals, locals)
File "<string>", line 1
SyntaxError: duplicate argument 'μ' in function definition |
|
Date |
User |
Action |
Args |
2018-06-16 18:02:08 | eric.smith | set | recipients:
+ eric.smith |
2018-06-16 18:02:08 | eric.smith | set | messageid: <1529172128.32.0.56676864532.issue33881@psf.upfronthosting.co.za> |
2018-06-16 18:02:08 | eric.smith | link | issue33881 messages |
2018-06-16 18:02:08 | eric.smith | create | |
|