[issue33452] add user notification that parent init will not be called in dataclass init method

Eric V. Smith report at bugs.python.org
Wed May 9 18:38:47 EDT 2018


Eric V. Smith <eric at trueblade.com> added the comment:

I'm okay with the concept, but I don't know how to implement it. You need to not only know if a class has a __init__, but also if it's expected to be called.

For example, these don't normally get called, but if you inherit from them (and everyone does inherit from object) you don't want a warning.

>>> hasattr(int, '__init__')
True
>>> hasattr(object, '__init__')
True

I'm open to ideas.

----------

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


More information about the Python-bugs-list mailing list