[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

Karthikeyan Singaravelan report at bugs.python.org
Wed Nov 6 08:29:49 EST 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Should we also be checking for __post_init__ to have positional only arguments / syntax in the signature. I tried a simple fix of f.name + "=" + f.name to pass them as keyword always where current tests and reported example passes but with positional arguments it could be a problem.

https://github.com/python/cpython/blob/5c0c325453a175350e3c18ebb10cc10c37f9595c/Lib/dataclasses.py#L516

----------
nosy: +xtreak

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


More information about the Python-bugs-list mailing list