Message231871
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). |
|
Date |
User |
Action |
Args |
2014-11-29 20:38:34 | gmt | set | recipients:
+ gmt |
2014-11-29 20:38:34 | gmt | set | messageid: <1417293514.02.0.452977288528.issue22968@psf.upfronthosting.co.za> |
2014-11-29 20:38:33 | gmt | link | issue22968 messages |
2014-11-29 20:38:33 | gmt | create | |
|