[issue33881] dataclasses should use NFKC to find duplicate members

Raymond Hettinger report at bugs.python.org
Fri Jun 12 18:19:45 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I recommend leaving the code as-is.  AFAICT, the situation almost never arises in practice, and if it did, the existing SyntaxError is clear.

Given that the rest of that language uses a SyntaxError, there isn't a net benefit for switching to TypeError:

>>> def f(µ=1, μ=2):
    	    pass
    	
SyntaxError: duplicate argument 'μ' in function definition
>>> def f(**kwds):
	return kwds

>>> f(µ=1, μ=2)
SyntaxError: keyword argument repeated

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33881>
_______________________________________


More information about the Python-bugs-list mailing list