On Thursday, March 8, 2012 5:25:06 PM UTC+2, hyperboogie wrote:
> Hello everyone.
>
> This is my first post in this group.
> I started learning python a week ago from the "dive into python" e-
> book and thus far all was clear.
> However today while reading chapter 5 about objects and object
> ori
Ian Kelly wrote:
> On Sun, Mar 11, 2012 at 5:40 AM, Ian Kelly wrote:
>>> 2. Is the mro function available only on python3?
>>
>> No, but it is available only on new-style classes. If you try it on a
>> classic class, you'll get an AttributeError.
>
> And by the way, you probably shouldn't call
On Sun, Mar 11, 2012 at 5:40 AM, Ian Kelly wrote:
>> 2. Is the mro function available only on python3?
>
> No, but it is available only on new-style classes. If you try it on a
> classic class, you'll get an AttributeError.
And by the way, you probably shouldn't call the mro method directly.
Tha
On Sun, Mar 11, 2012 at 4:56 AM, hyperboogie wrote:
> 1. What do you mean by "subclassing `object`"?
In Python 2 there are two different types of classes: classic classes,
which are retained for backward compatibility, and new-style classes,
which were introduced in Python 2.2. Classic classes a
On Sun, Mar 11, 2012 at 3:56 AM, hyperboogie wrote:
> On Sunday, March 11, 2012 12:38:27 PM UTC+2, Chris Rebert wrote:
>> On Sun, Mar 11, 2012 at 3:18 AM, hyperboogie wrote:
>>
>> > thank you everyone...
>> > Still things are not working as expected... what am I doing wrong?
>>
>> > # cat test.p
On Sunday, March 11, 2012 12:38:27 PM UTC+2, Chris Rebert wrote:
> On Sun, Mar 11, 2012 at 3:18 AM, hyperboogie wrote:
>
> > thank you everyone...
> > Still things are not working as expected... what am I doing wrong?
>
> > # cat test.py
> > #!/usr/bin/python
> >
> > class A():
>
> You should be
On Sun, Mar 11, 2012 at 3:18 AM, hyperboogie wrote:
> thank you everyone...
> Still things are not working as expected... what am I doing wrong?
> # cat test.py
> #!/usr/bin/python
>
> class A():
You should be subclassing `object`, but that's a minor point which
isn't the cause of your problem.
On Mar 11, 12:47 am, "Colin J. Williams" wrote:
> On 10/03/2012 12:58 PM, Colin J. Williams wrote:> On 08/03/2012 10:25 AM,
> hyperboogie wrote:
> >> Hello everyone.
>
> [snip]
> > main()
> > I'm not sure that the class initialization is required.
>
> > Good luck,
>
> > Colin W.
>
> When I wrote
On 10/03/2012 12:58 PM, Colin J. Williams wrote:
On 08/03/2012 10:25 AM, hyperboogie wrote:
Hello everyone.
[snip]
main()
I'm not sure that the class initialization is required.
Good luck,
Colin W.
When I wrote earlier, I wondered about the need for initialization.
With Version 2, both __
On 08/03/2012 10:25 AM, hyperboogie wrote:
Hello everyone.
This is my first post in this group.
I started learning python a week ago from the "dive into python" e-
book and thus far all was clear.
However today while reading chapter 5 about objects and object
orientation I ran into something tha
hyperboogie wrote:
Hello everyone.
This is my first post in this group.
I started learning python a week ago from the "dive into python" e-
book and thus far all was clear.
However today while reading chapter 5 about objects and object
orientation I ran into something that confused me.
it says h
Maarten wrote:
> Alternatively you can figure out the parent class with a call to super:
This is WRONG:
> super(self.__class__, self).__init__()
You have to name the current class explicitly. Consider:
>> class A(object):
... def __init__(self):
... print "in a"
...
>>
On Thursday, March 8, 2012 4:25:06 PM UTC+1, hyperboogie wrote:
> My question is if __init__ in the descendant class overrides __init__
> in the parent class how can I call the parent's __init__ from the
> descendant class - I just overrode it didn't I?
>
> Am I missing something more fundamental
Hello everyone.
This is my first post in this group.
I started learning python a week ago from the "dive into python" e-
book and thus far all was clear.
However today while reading chapter 5 about objects and object
orientation I ran into something that confused me.
it says here:
http://www.divei
14 matches
Mail list logo