Diff. between Class types and classic classes

V

venk

Hi,
can some one properly explain the differences between class types and
classic classes? ... Still face problems in identifying what is what.
 
B

bruno at modulix

venk said:
Hi,
can some one properly explain the differences between class types and
classic classes? ... Still face problems in identifying what is what.

I'm not sure I understand your question. Are you talking about the diff
between old-style and new-style classes, or the diff between classes and
metaclasses ?
 
C

Colin J. Williams

bruno said:
I'm not sure I understand your question. Are you talking about the diff
between old-style and new-style classes, or the diff between classes and
metaclasses ?
"new" classes inherit from object. Classic classes do not.
"new" classes have a __new__ method. Classic classes generally do not.
The type of a "new" class is types.TypeType
The type of a classic class is a classobj
The type of an instance of a "new" class is the name of the class
The type of an instnce of a classic class is an instance

This is shown below:.... def __init__(self):
.... pass
........ def __init__(self):
.... pass
....
I hope that this helps.

Colin W.
 
B

Bruno Desthuilliers

Colin J. Williams a écrit :
"new" classes inherit from object. Classic classes do not. (snip)

I hope that this helps.

Colin,

I don't personaly need much help with this !-) In fact, your answer is
almost the same as the one I was going to post - before I re-read the
OP's question. And I'm still not sure that what the OP is looking for.
 
C

Colin J. Williams

Bruno said:
Colin J. Williams a écrit :



Colin,

I don't personaly need much help with this !-) In fact, your answer is
almost the same as the one I was going to post - before I re-read the
OP's question. And I'm still not sure that what the OP is looking for.
Bruno,

Sorry, my reponse should have been addressed to venk.

Colin W
 
V

venk

Dear Colin,
Forgive me for this late reply. Your explanation was of great help to
me.
Thank you very much. It was crystal clear.
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top