On Tue, Jun 08, 2010 at 02:11:10AM +1000, Steven D'Aprano wrote:
> In Python 2.x, all classes are old-style unless you directly or
> indirectly inherit from object. If you inherit from nothing, it is an
> old-style class regardless of whether you say
>
> class Name: pass
>
> or
>
> class Nam
On 07/06/2010 17:30, pyt...@bdurham.com wrote:
Hi Mark,
I see that Stephen D'Aprano has already replied twice so I won't bother. Apart
from that no offence meant, I hope none taken.
Your RTFM reply actually gave me a good laugh. No (zero) offence taken.
And I appreciate your many helpful pos
Hi Mark,
> I see that Stephen D'Aprano has already replied twice so I won't bother.
> Apart from that no offence meant, I hope none taken.
Your RTFM reply actually gave me a good laugh. No (zero) offence taken.
And I appreciate your many helpful posts in these forums.
Cheers,
Malcolm
__
Steven,
Thanks again for your explanations. I thought I had missed a major
change in Python class behavior - relieved to find that I'm up-to-date.
Cheers,
Malcolm
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
htt
> In Python 2.x, all classes are old-style unless you directly or indirectly
> inherit from object. If you inherit from nothing, it is an old-style class
> regardless of whether you say class Name: pass or class Name(): pass. In
> Python 3.x, there are no old-style classes.
Thanks Steven!
Malc
On 07/06/2010 17:03, pyt...@bdurham.com wrote:
Hi Mark,
I was surprised to see class Name() work (in Python 2.6.5 at least). Is this
equivalent to class Name( object ) or does this create an old style class?
Going forward into the 2.7/3.x world, is there a preferred style?
RTFM? :)
I am
On Tue, 8 Jun 2010 02:03:18 am pyt...@bdurham.com wrote:
> Here's why I'm confused. The following paragraph from TFM seems to
> indicate that old style classes are the default:
Yes, if you don't inherit from object, or another class that inherits
from object (like the built-ins), you get an old-
On Tue, 8 Jun 2010 01:12:28 am pyt...@bdurham.com wrote:
> Not the OP, but I was surprised to see class Name() work (in Python
> 2.6.5 at least).
>
> Is this equivalent to class Name( object ) or does this create an old
> style class?
In Python 2.x, all classes are old-style unless you directly or
Hi Mark,
>> I was surprised to see class Name() work (in Python 2.6.5 at least). Is this
>> equivalent to class Name( object ) or does this create an old style class?
>> Going forward into the 2.7/3.x world, is there a preferred style?
> RTFM? :)
I am reading TFM :)
Here's why I'm confused. T
On 07/06/2010 16:12, pyt...@bdurham.com wrote:
Not the OP, but I was surprised to see class Name() work (in Python
2.6.5 at least).
Is this equivalent to class Name( object ) or does this create an old
style class?
Going forward into the 2.7/3.x world, is there a preferred style?
Thanks,
Malco
Not the OP, but I was surprised to see class Name() work (in Python
2.6.5 at least).
Is this equivalent to class Name( object ) or does this create an old
style class?
Going forward into the 2.7/3.x world, is there a preferred style?
Thanks,
Malcolm
__
On 6/7/2010 10:01 AM, Payal wrote:
Hi all,
I know the difference between
class Parent :
class Parent(object) :
But in some softwares i recall seeing,
class Parent() :
Is this legal syntax?
Teach: To answer that question, just try it at the interactive prompt.
If it is not legal syntax y
lol, for a second I thought this question comes from PayPal
On Mon, Jun 7, 2010 at 10:01 AM, Payal wrote:
> Hi all,
> I know the difference between
> class Parent :
> class Parent(object) :
>
> But in some softwares i recall seeing,
> class Parent() :
>
> Is this legal syntax?
>
> With warm r
13 matches
Mail list logo