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 gmt
Recipients gmt
Date 2014-11-29.20:38:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417293514.02.0.452977288528.issue22968@psf.upfronthosting.co.za>
In-reply-to
Content
Kinda trivial but...

Something like the enclosed, untested patch would seem to make new_class work a bit more like type_new.

To be explicit, the difference is whether or not to respect virtual subclasses.

So, for example, as implemented, we can implement __subclasscheck__ on a 'AtypicalMeta' metaclass to create an 'Atypical' class whose __mro__ is (ATypical, object) -- note, no 'type' -- but for which issubclass(type, ATypical) is true.

If I'm not mistaken, this disguise will suffice sneak our psuedo-metatype past new_class (but not type.__new__, so we still get the same error message, and the universe does not implode on itself as planned...)

In my case,the only sequela was that the fantasy of my very own type-orthogonal graph of "foo"-style classes in 3.x was first subtly encouraged and then dashed against the Cpython rocks... (just kidding, sort-of).
History
Date User Action Args
2014-11-29 20:38:34gmtsetrecipients: + gmt
2014-11-29 20:38:34gmtsetmessageid: <1417293514.02.0.452977288528.issue22968@psf.upfronthosting.co.za>
2014-11-29 20:38:33gmtlinkissue22968 messages
2014-11-29 20:38:33gmtcreate