Recent Notes

Displaying keyword search results 1 - 1
Created by Dr. Xi on April 19, 2011 16:01:39    Last update: April 19, 2011 16:01:39
This note relates to Python 2.x. A Python class is old-style by default, unless it has another new style class or the "top level" class object as its parent. The sure way to tell that an object is an instance of a new style class is to use the function type , type(x) returns <type 'instance'> for an old-style class, but it returns <class 'ClassType.X'> for a new-style class. Class definition: class A: # old style class def __init__(sel... Test session: >>> A <class ClassType.A at 0x7f36ae442fb0> ...