Re: super() woes (n00b)

2010-06-18 Thread Ethan Furman
Deadly Dirk wrote: On Thu, 17 Jun 2010 12:18:33 -0700, Ethan Furman wrote: Deadly Dirk wrote: On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: super gives you an instantiated version of the super class, which means that you don't have to explicitly send self to any methods you call o

Re: super() woes (n00b)

2010-06-18 Thread Jean-Michel Pichavant
Deadly Dirk wrote: On Fri, 18 Jun 2010 11:19:56 +0200, Jean-Michel Pichavant wrote: Deadly Dirk wrote: I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type "copyright", "credits" or "license()" for more information.

Re: super() woes (n00b)

2010-06-18 Thread Deadly Dirk
On Fri, 18 Jun 2010 11:19:56 +0200, Jean-Michel Pichavant wrote: > Deadly Dirk wrote: >> I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov >> 2 2009, 14:49:22) [GCC 4.4.1] on linux2 >> Type "copyright", "credits" or "license()" for more information. >> No Subprocess ===

Re: super() woes (n00b)

2010-06-18 Thread Deadly Dirk
On Thu, 17 Jun 2010 12:18:33 -0700, Ethan Furman wrote: > Deadly Dirk wrote: >> On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: >> >>> super gives you an instantiated version of the super class, which >>> means that you don't have to explicitly send self to any methods you >>> call on it

Re: super() woes (n00b)

2010-06-18 Thread Lie Ryan
On 06/18/10 19:19, Jean-Michel Pichavant wrote: > Deadly Dirk wrote: >> I cannot get right the super() function: >> Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 >> Type "copyright", "credits" or "license()" for more information. >> No Subprocess >> > class

Re: super() woes (n00b)

2010-06-18 Thread Jean-Michel Pichavant
Deadly Dirk wrote: I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type "copyright", "credits" or "license()" for more information. No Subprocess class P: def __init__(__class__,self): print("I

Re: super() woes (n00b)

2010-06-17 Thread Ethan Furman
Deadly Dirk wrote: On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: super gives you an instantiated version of the super class, which means that you don't have to explicitly send self to any methods you call on it. So use `super().__init__()` instead. Thanks. Interestingly enough, it

Re: super() woes (n00b)

2010-06-17 Thread Benjamin Kaplan
On Thu, Jun 17, 2010 at 10:51 AM, Matteo Landi wrote: > I found few error in your code: > 1 the constructor of P class seems to be wrong: > class P(object): > ...    def __init__(self): > ...        print("I am a member of class P") > ... > > 2 super() works with new style classes, i.e.  the

Re: super() woes (n00b)

2010-06-17 Thread Deadly Dirk
On Thu, 17 Jun 2010 13:48:45 -0400, J. Cliff Dyer wrote: > super gives you an instantiated version of the super class, which means > that you don't have to explicitly send self to any methods you call on > it. > > So use `super().__init__()` instead. Thanks. Interestingly enough, it works in Pyt

Re: super() woes (n00b)

2010-06-17 Thread Matteo Landi
I found few error in your code: 1 the constructor of P class seems to be wrong: >>> class P(object): ...def __init__(self): ...print("I am a member of class P") ... 2 super() works with new style classes, i.e. the ones which inherit from 'object' >>> class P: ...def __init__(__c

Re: super() woes (n00b)

2010-06-17 Thread J. Cliff Dyer
On Thu, 2010-06-17 at 16:36 +, Deadly Dirk wrote: > I cannot get right the super() function: > Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) > [GCC 4.4.1] on linux2 > Type "copyright", "credits" or "license()" for more information. > No Subprocess > >>> class P: > def __init_

Re: super() woes (n00b)

2010-06-17 Thread Deadly Dirk
On Thu, 17 Jun 2010 16:36:10 +, Deadly Dirk wrote: > I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov > 2 2009, 14:49:22) [GCC 4.4.1] on linux2 > Type "copyright", "credits" or "license()" for more information. No > Subprocess class P: > def __init__(

super() woes (n00b)

2010-06-17 Thread Deadly Dirk
I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type "copyright", "credits" or "license()" for more information. No Subprocess >>> class P: def __init__(__class__,self): print("I am a member of class P")