Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!amsnews11.chello.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'def': 0.14; '16,': 0.15; 'cc:addr:python-list': 0.15; 'wed,': 0.17; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.23; 'cc:2**0': 0.25; 'pass': 0.28; 'bound': 0.28; 'cc:addr:python.org': 0.29; 'message-id:@mail.gmail.com': 0.29; 'print': 0.29; 'class': 0.29; 'received:209.85.214': 0.30; 'received:mail-bw0-f46.google.com': 0.30; 'nov': 0.31; 'pm,': 0.31; 'yet': 0.32; 'it.': 0.33; 'skip:@ 10': 0.34; 'received:google.com': 0.38; 'received:209.85': 0.38; 'define': 0.39; 'subject:: ': 0.39; 'received:209': 0.40; '2011': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zvd06t5ngeHQR/vEUANBeQeslL5g2T3gJ7Q+mEk0n3U=; b=hwVwotEeiy3TWZ5GAMPFA4sSp5onGCzY+XcjO9ewiTGyhSJtPJKzLh2z8+bt8qD9tY Q7gROWzuxv7ys+byypUlQarhvJkM7XM25rAFtcyeoduPf30vYps0fhUxwyFAqtd5+WtO LztfLR4cqsj4Tar+FhriRRiHlx2efod0FzMHQ= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Thu, 17 Nov 2011 00:37:57 -0700 Subject: Re: staticmethod makes my brain hurt To: Dotan Cohen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321515508 news.xs4all.nl 6918 [2001:888:2000:d::a6]:60655 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15809 On Wed, Nov 16, 2011 at 11:44 PM, Dotan Cohen wrote: > Try this (untested): > > class C: > =A0 @staticmethod > =A0 def foo(): > =A0 =A0 =A0 pass > > =A0 print "inside", C.foo, callable(C.foo) If you had tested this, you would have found that you get a NameError, since C is not yet bound inside the class block where you define it.