Re: Inherting from object. Or not.

2005-01-28 Thread Nick Coghlan
Nick Craig-Wood wrote: Nick Coghlan <[EMAIL PROTECTED]> wrote: Exactly. My advice is to use new-style classes unless you have a reason not to (if you're inheriting from a builtin type, then there is no need to inherit from object as well - the builtin types already have the correct basic type). Ex

Re: Inherting from object. Or not.

2005-01-27 Thread Nick Craig-Wood
Nick Coghlan <[EMAIL PROTECTED]> wrote: > Exactly. My advice is to use new-style classes unless you have a > reason not to (if you're inheriting from a builtin type, then there > is no need to inherit from object as well - the builtin types > already have the correct basic type). Except for Ex

Re: Inherting from object. Or not.

2005-01-27 Thread Nick Coghlan
Frans Englich wrote: On Wednesday 26 January 2005 21:24, M.E.Farmer wrote: Hello Frans, What you are seeing is a step on the path to unification of types and classes. I changed all base classes in my project to inherit object. There appears to be no reason to not do it, AFAICT. Exactly. My advice

Re: Inherting from object. Or not.

2005-01-26 Thread Frans Englich
On Wednesday 26 January 2005 21:24, M.E.Farmer wrote: > Hello Frans, > What you are seeing is a step on the path to unification of types and > classes. I changed all base classes in my project to inherit object. There appears to be no reason to not do it, AFAICT. Thanks, Frans

Re: Inherting from object. Or not.

2005-01-26 Thread Peter Hansen
Frans Englich wrote: What is the difference between inherting form object, and not doing it? Although this doesn't provide a description of all the implications, it does give you the basic answer to the question and you can easily do further research to learn more: http://www.python.org/doc/2.2.1/

Re: Inherting from object. Or not.

2005-01-26 Thread Lee Harr
> What is the difference between inherting form object, and not doing it? E.g, > what's the difference between the two following classes? > > class foo: > pass > > class bar(object): > pass > > Sometimes people inherit from it, and sometimes not. I don't see a pattern in > their choic

Re: Inherting from object. Or not.

2005-01-26 Thread M.E.Farmer
Hello Frans, What you are seeing is a step on the path to unification of types and classes. Now we have that clear ;) Classes that inherit from object are 'new style classes'. They were introduced in 2.2 and they have different internal methods. The ones that have no declaration is an 'old style cl

Inherting from object. Or not.

2005-01-26 Thread Frans Englich
(Picking up a side track of the "python without OO" thread.) On Wednesday 26 January 2005 11:01, Neil Benn wrote: > I say this because you do need to be aware of the > 'mythical python wand' which will turn you from a bad programmer into a > good programmer simply by typing 'class Klass(object):