On Sat, 02 Jul 2005 12:26:49 -0700, Scott David Daniels <[EMAIL PROTECTED]>
wrote:
>Bengt Richter wrote:
>> On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels <[EMAIL PROTECTED]>
>> wrote:
>>>Or, perhaps:
>>>class foo(object):
>>>def __init__(self, *args, **kwargs):
>>>
On Sat, 02 Jul 2005 14:17:32 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> BTW, there's something about referring to type(self) by its not
>> always dependably bound (though usually global) name that bothers me.
>>
>> I wonder if the above common use of super could be im
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I wonder if the above common use of super could be implemented as a
> property of object,
> so you'd normally inherit it and be able to write
>self.super.__init__(*args, **kwargs) # (maybe spell it
> self.__super
Bengt Richter wrote:
> I wonder if the above common use of super could be implemented as a property
> of object,
> so you'd normally inherit it and be able to write
> self.super.__init__(*args, **kwargs) # (maybe spell it
> self.__super__.__init__(...) I suppose)
>
> I.e., self.__super__ wo
Bengt Richter wrote:
> On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels <[EMAIL PROTECTED]>
> wrote:
>>Or, perhaps:
>>class foo(object):
>>def __init__(self, *args, **kwargs):
>>super(foo, self).__init__(self, *args, **kwargs)
>>...
>>
>
> Doesn't super(
Bengt Richter wrote:
> BTW, there's something about referring to type(self) by its not
> always dependably bound (though usually global) name that bothers me.
>
> I wonder if the above common use of super could be implemented as a property
> of object,
> so you'd normally inherit it and be able t
On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels <[EMAIL PROTECTED]>
wrote:
>Sion Arrowsmith wrote:
>> ... And if you were to do so, surely:
>> class foo(object):
>> def __init__(self, *args, **kwargs):
>> super(foo, self).__init__(self)
>>
>> would be the preferred way to go?
>>
Sion Arrowsmith wrote:
> ... And if you were to do so, surely:
> class foo(object):
> def __init__(self, *args, **kwargs):
> super(foo, self).__init__(self)
>
> would be the preferred way to go?
>
Or, perhaps:
class foo(object):
def __init__(self, *args, **kwargs):
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
>Fuzzyman a écrit :
>> *Should* I in fact write :
>>
>> class foo(object):
>> def __init__(self, *args, **kwargs):
>> object.__init__(self)
>>
>> ?
>Nope.
And if you were to do so, surely:
class foo(object):
def __init__(self, *arg
The reason I ask is that I often (well... a couple of times anyway) see
cryptic omments like :
and if you inherit from object you get all the benefits of new
style classes
Now I know about the advantages of inheriting from the built in types
(if that's what you want to do) -but am a bit fuzzi
Steven Bethard wrote:
> Guido also suggests that the explicit:
>
> class C(object):
> pass
>
> is "much preferred"[2] over:
>
> __metaclass__ = type
>
> class C:
> pass
Really? I have been toying with the idea of using the __metaclass__
trick, since it results in c
Fuzzyman wrote:
> Surely when they are removed :
>
> class foo:
> pass
>
> won't become invalid syntax, it will just automatically inherit from
> object ?
Well, Guido views this particular syntax as an "oopsie"[1]. It should
actually look like:
class C():
pass
Guido also su
So theres no actual advantage that you know of ;-)
Surely when they are removed :
class foo:
pass
won't become invalid syntax, it will just automatically inherit from
object ?
That's what I assumed, anyway
Regards,
Fuzz
http://www.voidspace.org.uk/python
--
http://mail.python.org/ma
Fuzzyman wrote:
> Also, can anyone explain any tangible benefit of inheriting from
> object, when not explicitly using any features of new style classes ?
One reason is that properties won't work correctly.
--
Benji York
--
http://mail.python.org/mailman/listinfo/python-list
ct):
> def __init__(self, *args, **kwargs):
> object.__init__(self)
>
> ?
Nope.
> Also, can anyone explain any tangible benefit of inheriting from
> object, when not explicitly using any features of new style classes ?
old-style classes are deprecated. They are
ct):
> def __init__(self, *args, **kwargs):
> object.__init__(self)
>
> ?
I don't believe so.
> Also, can anyone explain any tangible benefit of inheriting from
> object, when not explicitly using any features of new style classes ?
This class might not, but yo
anyone explain any tangible benefit of inheriting from
object, when not explicitly using any features of new style classes ?
Thanks :-)
Fuzzyman
http://www.voidspace.org.uk/python
--
http://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo