Re: new-style classes and len method



Thomas Girod wrote:
It's alright I found where my mistake came from. I was misunderstanding
the meaning of "classmethod", thinking of it as an instance method.

Given that 'instance methods' being most of the time attributes of the
class object, such a confusion is not so surprising !-)

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb@xxxxxxxxxxx'.split('@')])"
.



Relevant Pages

  • Re: current type in static methods
    ... >> because using GetTypeor class has a different meaning, ... >> instance method is useful too ... the first option alters the meaning of the "this" ... keyword which is not good. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What is/are the difference(s) between assertSame and assertEquals in JUnit?
    ... It would have made the meaning of it more obvious. ... This extends the convention that "isX" expresses a boolean condition "X", and avoids the noise-word "Object" in the method name. ... May be it is not 'assertIsSame' as it is not an instance method and takes up two arguments, so one may think of 'assertAreSame'. ...
    (comp.lang.java.programmer)
  • Re: new-style classes and len method
    ... I was misunderstanding ... the meaning of "classmethod", thinking of it as an instance method. ...
    (comp.lang.python)
  • RE: list.sorted()
    ... >> I declared a classmethod, then called it from an instance, as in the ... > instance, and then dispatch on that, but that might be a bit ... By "more cumbersome" are you talking simply about having to ... plain ol' instance method. ...
    (comp.lang.python)
  • Re: More __init__ methods
    ... Different behaviours should be in different functions. ... instance method inside the classmethod. ... but if I use this @classmethod style to simplify the ...
    (comp.lang.python)