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 bar.harel
Recipients bar.harel, docs@python
Date 2022-03-06.11:34:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Not sure if a continuance of or not, but the suggestion to call super().__init__() in __post__init__ will cause infinite recursion if the superclass also contains __post__init__:

>>> @d
... class A:
...  test: int
...  def __post_init__(self):
...    pass

>>> @d
... class B(A):
...  test2: int
...  def __post_init__(self):
...    super().__init__(test=1)

>>> B(test2=1, test=3) <-- infinite recursion.

This is caused by line 564 ( checking for post init on current class, and calling it on self (child class).

Not sure if the bug is in the documentation/suggestion, or if it's a bug in the implementation, in which case we need to call the current class's __post_init__.
Date User Action Args
2022-03-06 11:34:34bar.harelsetrecipients: + bar.harel, docs@python
2022-03-06 11:34:34bar.harelsetmessageid: <>
2022-03-06 11:34:34bar.harellinkissue46938 messages
2022-03-06 11:34:33bar.harelcreate