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 eric.smith
Recipients eric.smith
Date 2018-06-16.18:02:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529172128.32.0.56676864532.issue33881@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-06-16 18:02:08eric.smithsetrecipients: + eric.smith
2018-06-16 18:02:08eric.smithsetmessageid: <1529172128.32.0.56676864532.issue33881@psf.upfronthosting.co.za>
2018-06-16 18:02:08eric.smithlinkissue33881 messages
2018-06-16 18:02:08eric.smithcreate