[Twisted-Python] what is a non-class class?

Wolfgang Rohdewald wolfgang.kde at rohdewald.de
Wed Sep 3 00:45:58 MDT 2014


I still do not like "non-class class" because this is a contradiction
in itself.
 
Anyway a non-class class is a class whose objects may not get a 
method attached. So far so good, but that was obvious.

Am Dienstag, 2. September 2014, 16:29:41 schrieb Glyph Lefkowitz:
> Except I think it might be broken in the face of new-style classes;
> ClassType is the old-style class type, 'type' is the new one, so,
> that should probably be fixed

That is my problem. How do I know if the object is of a non-class class?
As you say, current code does not handle new style classes.

I cannot check if the object is of type "type" because 
int is also of type "type". An int certainly should not get
a method attached. Then we could just as well remove this check.

That is why I proposed to instead exclude a list of basic types
int, float, list, dict, set and so on.

-- 
Wolfgang




More information about the Twisted-Python mailing list