Re: Constructors...BIIIIG PROBLEM!
- From: Ian Kelly <ian.g.kelly@xxxxxxxxx>
- Date: Thu, 1 Sep 2011 07:57:00 -0600
On Thu, Sep 1, 2011 at 3:04 AM, Michiel Overtoom <motoom@xxxxxxxxx> wrote:
On Sep 1, 2011, at 10:24, Hegedüs Ervin wrote:
On Thu, Sep 01, 2011 at 10:00:27AM +0200, Michiel Overtoom wrote:
Derive your class from object,
why's that better than just create a simple class, without
derive?
Amongst other things, fixes to the type system and the method resolution order.
http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes
http://unspecified.wordpress.com/2010/11/18/pythons-new-classes-vs-old-classes/
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html
http://www.python.org/download/releases/2.2.3/descrintro/
That is for Python 2. For Python 3, old-style classes are gone, all
classes derive from object by default, and writing it explicitly is
merely good style for compatibility.
.
- Prev by Date: instructor's solutions manual for Physics - Principles and Problems
- Next by Date: Re: fun with nested loops
- Previous by thread: Re: Constructors...BIIIIG PROBLEM!
- Next by thread: Regex to match all trailing whitespace _and_ newlines.
- Index(es):
Relevant Pages
|