Armin Rigo added the comment:

FWIW ``bool(Null())`` gives "correctly" the result False in CPython 3.5.

The problem in my opinion is that "!Py_TPFLAGS_BASETYPE" is checked only on the 
best base instead of on all bases.  It lets this kind of nonsense pass through.

In CPython 2.7 (but not 3.5) the following example also works (and is equally 
nonsense):

    class A(int): pass
    class Bogus(A, bool): pass

Although we're subclassing NoneType or bool, I did not manage to get a CPython 
crash from any of these examples.

----------
nosy: +arigo

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24806>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to