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 serhiy.storchaka
Recipients AlexWaygood, GBeauregard, JelleZijlstra, kj, serhiy.storchaka, sobolevn
Date 2022-02-06.12:31:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644150713.08.0.743261810917.issue46642@roundup.psfhosted.org>
In-reply-to
Content
Note that instances of most other types are non-subclassable "by accident".

>>> class A(42): pass
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: int() takes at most 2 arguments (3 given)

>>> class B:
...     def __init__(self, *args): pass
... 
>>> class C(B()): pass
... 
>>> C
<__main__.B object at 0x7fdcfb49aae0>

It is okay until we decide that there is a problem, and it that case it would require more general solution.

Are there any issues with this in real code?
History
Date User Action Args
2022-02-06 12:31:53serhiy.storchakasetrecipients: + serhiy.storchaka, JelleZijlstra, sobolevn, kj, AlexWaygood, GBeauregard
2022-02-06 12:31:53serhiy.storchakasetmessageid: <1644150713.08.0.743261810917.issue46642@roundup.psfhosted.org>
2022-02-06 12:31:53serhiy.storchakalinkissue46642 messages
2022-02-06 12:31:53serhiy.storchakacreate