Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45693

Re: @staticmethods called more than once

Newsgroups comp.lang.python
Date 2013-05-21 18:23 -0700
References <02f0123d-2f9e-4287-b983-cfa1db9db69c@googlegroups.com> <CANc-5UwztuXt6RYU1yQMrBOtMLyA32F2fYf6SF3iAxZ2bjwvAw@mail.gmail.com> <mailman.1928.1369155111.3114.python-list@python.org>
Message-ID <83db731c-bc25-40cd-9271-815e11cb9088@googlegroups.com> (permalink)
Subject Re: @staticmethods called more than once
From 88888 Dihedral <dihedral88888@googlemail.com>

Show all headers | View raw


Ethan Furman於 2013年5月22日星期三UTC+8上午12時30分22秒寫道:
> On 05/21/2013 08:39 AM, Skip Montanaro wrote:
> 
> > Don't confuse the use of "static" in Python with its use in C/C++.  From a post on StackOverflow:
> 
> >
> 
> >     A staticmethod is a method that knows nothing about the class or instance it was called on. It just gets the
> 
> >     arguments that were passed, no implicit first argument. It is basically useless in Python -- you can just use a
> 
> >     module function instead of a staticmethod.
> 
> 
> 
> For there record, staticmethod is useful when you want to make it possible for subclasses to change behavior.
> 
> 
> 
> --
> 
> ~Ethan~

I prefer objects in classes with slimer figures not heavily weighted
with trivial methods in each instance construction and clone.

 But this is only my personal style of classes in python.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

@staticmethods called more than once Christian <mining.facts@gmail.com> - 2013-05-21 08:26 -0700
  Re: @staticmethods called more than once Skip Montanaro <skip@pobox.com> - 2013-05-21 10:39 -0500
  Re: @staticmethods called more than once John Gordon <gordon@panix.com> - 2013-05-21 16:34 +0000
    Re: @staticmethods called more than once John Gordon <gordon@panix.com> - 2013-05-21 16:48 +0000
      Re: @staticmethods called more than once Christian <mining.facts@gmail.com> - 2013-05-21 10:17 -0700
  Re: @staticmethods called more than once Ethan Furman <ethan@stoneleaf.us> - 2013-05-21 09:30 -0700
    Re: @staticmethods called more than once 88888 Dihedral <dihedral88888@googlemail.com> - 2013-05-21 18:23 -0700

csiph-web