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 arigo
Recipients arigo
Date 2016-12-06.11:56:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481025418.85.0.187901644209.issue28884@psf.upfronthosting.co.za>
In-reply-to
Content
(B5) this is an old issue that was forgotten twice on the
  issue tracker: ``class C: __new__=int.__new__`` and ``class C(int):
  __new__=object.__new__`` can each be instantiated, even though they
  shouldn't.  This is because ``__new__`` is completely ignored if it is
  set to any built-in function that uses ``tp_new_wrapper`` as its C code
  (many of the built-in types' ``__new__`` are like that).
  http://bugs.python.org/issue1694663#msg75957,
  http://bugs.python.org/issue5322#msg84112.  In (at least) CPython 3.5,
  a few classes work only thanks to abuse of this bug: for example,
  ``io.UnsupportedOperation.__new__(io.UnsupportedOperation)`` doesn't
  work, but that was not noticed because ``io.UnsupportedOperation()``
  mistakenly works.
History
Date User Action Args
2016-12-06 11:56:58arigosetrecipients: + arigo
2016-12-06 11:56:58arigosetmessageid: <1481025418.85.0.187901644209.issue28884@psf.upfronthosting.co.za>
2016-12-06 11:56:58arigolinkissue28884 messages
2016-12-06 11:56:58arigocreate