On 15 mai, 17:53, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> > FWIW, I wonder why the BDFL choosed to implement __new__ as a
> > staticmethod - there are probably some pretty good reasons, but not
> > knowing them, it looks like __new__ would hav
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> FWIW, I wonder why the BDFL choosed to implement __new__ as a
> staticmethod - there are probably some pretty good reasons, but not
> knowing them, it looks like __new__ would have been a perfect
> candidate for a classmethod.
>
> So far, the only
Arnaud Delobelle a écrit :
[EMAIL PROTECTED] wrote:
On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
__new__ is a static method!
__new__ is a special-cased staticmethod
[EMAIL PROTECTED] wrote:
> On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> > >> __new__ is a static method!
> >
> > > __new__ is a special-cased staticmethod tha
vbgunz a écrit :
Instance methods make the most sense. A static method makes sense too
*but* I can see how a class method not only does what a static method
does but how a class method *also* gets the cls reference for free.
I don't understand the last part - but I certainly agree on the "instan
vbgunz a écrit :
I remember learning closures in Python and thought it was the dumbest
idea ever. Why use a closure when Python is fully object oriented? I
didn't grasp the power/reason for them until I started learning
JavaScript and then BAM, I understood them.
Just a little while ago, I had a
On May 14, 4:38 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 14 mai, 16:30, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> > > > An instance method works on the instance
> > > > A Static method is basically a function
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
>> > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>> >> __new__ is a static method!
>>
>> > __new__ is a special-cased
On Wed, 14 May 2008 09:21:10 -0700, vbgunz wrote:
> [...]
> when you see
> one, what is the first thing that comes to mind? When you write one,
> what was the first thing on your mind? Other than "similar to static-
> methods", at what point will you be glad you used one? To sum it up,
> what is t
On 14 mai, 22:44, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> > On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> >> __new__ is a static method!
>
> > __new__ is a special-cased staticmethod that 1/ must not be declared
> > as such
On May 14, 12:21 pm, vbgunz <[EMAIL PROTECTED]> wrote:
> Other than the 2 reasons above (2 making more sense), what is a really
> good reason to pull out the class method. In other words, when you see
> one, what is the first thing that comes to mind? When you write one,
> what was the first thing
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>> __new__ is a static method!
>
> __new__ is a special-cased staticmethod that 1/ must not be declared
> as such and 2/ takes the class object as first args. As far as I'm
> concerned,
On 14 mai, 16:30, George Sakkis <[EMAIL PROTECTED]> wrote:
> On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> > > An instance method works on the instance
> > > A Static method is basically a function nested within a class object
> > > A class method is overkill?
>
> > If anyt
On 14 mai, 19:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> George Sakkis <[EMAIL PROTECTED]> writes:
> > On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> >> > An instance method works on the instance
> >> > A Static method is basically a function nested within a class obj
George Sakkis <[EMAIL PROTECTED]> writes:
> On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>> > An instance method works on the instance
>> > A Static method is basically a function nested within a class object
>> > A class method is overkill?
>>
>> If anything, a static meth
> > > Instance methods make the most sense. A static method makes sense too
> > > *but* I can see how a class method not only does what a static method
> > > does but how a class method *also* gets the cls reference for free.
>
> > I don't understand the last part - but I certainly agree on the "in
> > Instance methods make the most sense. A static method makes sense too
> > *but* I can see how a class method not only does what a static method
> > does but how a class method *also* gets the cls reference for free.
>
> I don't understand the last part - but I certainly agree on the "instance
>
> When I learned about static methods, I learned they're a way to
> tightly couple some functionality with a class without tying the
> functionality to any of the instances. I see them as nothing more than
> a design decision. To me they make some sense.
Which you can say exactly about classmethod
> > An instance method works on the instance
> > A Static method is basically a function nested within a class object
> > A class method is overkill?
>
> If anything, a static method is overkill...
> class Foo:
>
> [EMAIL PROTECTED]
> def register(cls, listener):
> cls.LISTENERS.append(
On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > An instance method works on the instance
> > A Static method is basically a function nested within a class object
> > A class method is overkill?
>
> If anything, a static method is overkill. See it this way: *if* you for some
> An instance method works on the instance
> A Static method is basically a function nested within a class object
> A class method is overkill?
If anything, a static method is overkill. See it this way: *if* you for some
reason put a method into an enclosing context - isn't it worth having a
refer
I remember learning closures in Python and thought it was the dumbest
idea ever. Why use a closure when Python is fully object oriented? I
didn't grasp the power/reason for them until I started learning
JavaScript and then BAM, I understood them.
Just a little while ago, I had a fear of decorators
22 matches
Mail list logo