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
orientation
On Mar 11, 12:47 am, Colin J. Williams c...@ncf.ca 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
On Sun, Mar 11, 2012 at 3:18 AM, hyperboogie hyperboo...@gmail.com wrote:
snip
thank you everyone...
Still things are not working as expected... what am I doing wrong?
snip
# cat test.py
#!/usr/bin/python
class A():
You should be subclassing `object`, but that's a minor point which
isn't
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:
snip
thank you everyone...
Still things are not working as expected... what am I doing wrong?
snip
# cat test.py
#!/usr/bin/python
class A():
You should be
On Sun, Mar 11, 2012 at 3:56 AM, hyperboogie hyperboo...@gmail.com 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:
snip
thank you everyone...
Still things are not working as expected... what am I doing wrong?
snip
On Sun, Mar 11, 2012 at 4:56 AM, hyperboogie hyperboo...@gmail.com 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.
On Sun, Mar 11, 2012 at 5:40 AM, Ian Kelly ian.g.ke...@gmail.com 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
Ian Kelly wrote:
On Sun, Mar 11, 2012 at 5:40 AM, Ian Kelly ian.g.ke...@gmail.com 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
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 that
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
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:
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
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
...
class
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
14 matches
Mail list logo