On Sat, Aug 6, 2011 at 11:04, Chris Rebert wrote:
> On Sat, Aug 6, 2011 at 12:34 AM, Eli Bendersky wrote:
>> Consider this standard metaclass definition:
>>
>> class MyMetaclass(type):
>> def __init__(cls, name, bases, dct):
>> super(MyMetaclass, cls).__init__(name, bases, dct)
>>
Eli Bendersky wrote:
> Consider this standard metaclass definition:
>
> class MyMetaclass(type):
> def __init__(cls, name, bases, dct):
> super(MyMetaclass, cls).__init__(name, bases, dct)
> # do meta-stuff
>
> class Foo(object):
> __metaclass__ = MyMetaclass
>
> The cal
On Sat, Aug 6, 2011 at 12:34 AM, Eli Bendersky wrote:
> Consider this standard metaclass definition:
>
> class MyMetaclass(type):
> def __init__(cls, name, bases, dct):
> super(MyMetaclass, cls).__init__(name, bases, dct)
> # do meta-stuff
>
> class Foo(object):
> __metaclass__
Consider this standard metaclass definition:
class MyMetaclass(type):
def __init__(cls, name, bases, dct):
super(MyMetaclass, cls).__init__(name, bases, dct)
# do meta-stuff
class Foo(object):
__metaclass__ = MyMetaclass
The call "super(MyMetaclass, cls)" should returns t
John Clark wrote:
> Please be aware that super() has it's own set of gotchas - it's not as clean
> as you would hope. For more info: http://fuhm.org/super-harmful/
>
> (I'm not the author, I was referred to this article while struggling with
> wxPython and super())
>
This was interesting! I'm u
John Clark a écrit :
> Yeah!!! One I can actually answer!!!
>
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
Jarek Zgoda a écrit :
> [EMAIL PROTECTED] napisał(a):
>
>
(snip)
>>class NewPage(HTMLMain):
>>def __init__(self):
>>print 'derive2 init'
>>super(NewPage, self).__init__();
>
>
> This should read: super(HTMLMain, self).__init__()
Nope. It's just how it should be.
--
http:
Laszlo Nagy napisał(a):
> Definitely, this is not true. Well, it depends what the OP wanted to do
> here, but in 99.9% of the cases, you want to use
Hah! I cancelled this message but seconds too late...
--
Jarek Zgoda
http://jpa.berlios.de/
--
http://mail.python.org/mailman/listinfo/python-lis
--
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Laszlo
Nagy
Sent: Wednesday, April 04, 2007 4:09 PM
To: Jarek Zgoda; python-list@python.org; [EMAIL PROTECTED]
Subject: Re: calling super()
Jarek Zgoda wrote:
>> Hello, I have been trying to call the super constructor from my
>
Jarek Zgoda wrote:
>> Hello, I have been trying to call the super constructor from my
>> derived class but its not working as expected. See the code:
>>
>> class HTMLMain:
>> def __init__(self):
>> self.text = "";
>> print(self.text);
>> def __del__(self):
>> self.te
John Clark wrote:
> Yeah!!! One I can actually answer!!!
>
Nice to see such enthusiasm. Well done!
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Recent Ramblings
On Apr 4, 12:22 pm, [EMAIL PROTECTED] wrote:
> Hello, I have been trying to call the super constructor from my
> derived class but its not working as expected. See the code:
>
> class HTMLMain:
> def __init__(self):
> self.text = "";
> print(self.text);
> def __del__(self):
[EMAIL PROTECTED] napisał(a):
> Hello, I have been trying to call the super constructor from my
> derived class but its not working as expected. See the code:
>
> class HTMLMain:
> def __init__(self):
> self.text = "";
> print(self.text);
> def __del__(self):
> sel
--Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, April 04, 2007 3:23 PM
To: python-list@python.org
Subject: calling super()
Hello, I have been trying to call the super constructor from my derived
class but its not working as exp
> And here's the error message I get:
>
> Traceback (most recent call last):
> File "e:/PyEN/inherit.py", line 16, in
> N = NewPage();
> File "e:/PyEN/inherit.py", line 12, in __init__
> super(NewPage, self).__init__();
> TypeError: super() argument 1 must be type, not classobj
>
S
Hello, I have been trying to call the super constructor from my
derived class but its not working as expected. See the code:
class HTMLMain:
def __init__(self):
self.text = "";
print(self.text);
def __del__(self):
self.text = "";
print(self.text);
class New
16 matches
Mail list logo