type() for new style classes - buggy?

M

Michal Vitecek

hello,

does the type() command work correctly for new style classes? i guess
it does not, unfortunately. for example, for a new style class'
1

how can one then determine what he's working with when he uses new
style classes (either instance or class)?

thank you,
 
S

Sidharth Kuruvila

In the case of new style classes type actually doubles up as a class
constructor, so all classes including type itself are instances type.
.... pass
....
hope this helps
there is some documentation on new style classes you might want to read.
http://www.python.org/doc/newstyle.html
particularly the first essay by Guido.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,665
Latest member
salkete

Latest Threads

Top