Re: Diff. between Class types and classic classes
Dear Colin, Forgive me for this late reply. Your explanation was of great help to me. Thank you very much. It was crystal clear. -- http://mail.python.org/mailman/listinfo/python-list
Re: Diff. between Class types and classic classes
Bruno Desthuilliers wrote: Colin J. Williams a écrit : bruno at modulix wrote: venk wrote: 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 ? 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. Bruno, Sorry, my reponse should have been addressed to venk. Colin W -- http://mail.python.org/mailman/listinfo/python-list
Diff. between Class types and classic classes
Hi, can some one properly explain the differences between class types and classic classes? ... Still face problems in identifying what is what. -- http://mail.python.org/mailman/listinfo/python-list
Re: Diff. between Class types and classic classes
venk wrote: 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 ? -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')]) -- http://mail.python.org/mailman/listinfo/python-list
Re: Diff. between Class types and classic classes
bruno at modulix wrote: venk wrote: 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 ? 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: class A(object): ... def __init__(self): ... pass ... a= A() class B: ... def __init__(self): ... pass ... b= B() type(A) type 'type' type(a) class '__main__.A' type(B) type 'classobj' type(b) type 'instance' I hope that this helps. Colin W. -- http://mail.python.org/mailman/listinfo/python-list
Re: Diff. between Class types and classic classes
Colin J. Williams a écrit : bruno at modulix wrote: venk wrote: 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 ? 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. -- http://mail.python.org/mailman/listinfo/python-list