Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #15816
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <dotancohen@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.026 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; "(i'm": 0.09; 'def': 0.14; '16,': 0.15; 'cc:addr:python-list': 0.15; 'now).': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'java': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.23; 'cc:2**0': 0.25; "i'm": 0.26; '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; 'kelly': 0.30; 'shooting': 0.30; 'nov': 0.31; 'pm,': 0.31; 'thu,': 0.32; 'yet': 0.32; 'does': 0.32; 'pretty': 0.32; 'it.': 0.33; '17,': 0.34; 'matter,': 0.34; 'skip:@ 10': 0.34; 'received:74.125.82': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:74.125': 0.39; 'define': 0.39; 'subject:: ': 0.39; 'far': 0.40; '2011': 0.62; 'url:co': 0.62 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=SgyCFUxmXrrT4jUMXeRAGs+DvCSTBGvxF1sgMFedrnI=; b=sioC63K0z5+7UCNmayTlpBfiM4yM/QCMX4Th4ThaJtgNdIBQWhTiBIOoAL/grS/uIN 5k+eGBcr3PWVgC/uYXoRW+eU3C+gO8zFrCIUdkxStDBa5r0S7S4fyScjIq3vpqkXAved Lt5ZRIbS7iuLKM9C+DN4m4C9tifeHfL1x0bSc= |
| MIME-Version | 1.0 |
| In-Reply-To | <CALwzidn0GsfapWEK20Csb5Fwh1D6wA=o05zdxoA8k-63HoO1Mw@mail.gmail.com> |
| References | <roy-DD1C5B.21305716112011@news.panix.com> <CAKDXFkMZ=TLYO1sPCU1JMBkNOibchnE361_HGHCX+EbWn_GsBA@mail.gmail.com> <CALwzidn0GsfapWEK20Csb5Fwh1D6wA=o05zdxoA8k-63HoO1Mw@mail.gmail.com> |
| Date | Thu, 17 Nov 2011 13:13:38 +0200 |
| Subject | Re: staticmethod makes my brain hurt |
| From | Dotan Cohen <dotancohen@gmail.com> |
| To | Ian Kelly <ian.g.kelly@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2803.1321528426.27778.python-list@python.org> (permalink) |
| Lines | 26 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1321528427 news.xs4all.nl 6928 [2001:888:2000:d::a6]:50550 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:15816 |
Show key headers only | View raw
On Thu, Nov 17, 2011 at 09:37, Ian Kelly <ian.g.kelly@gmail.com> wrote: > On Wed, Nov 16, 2011 at 11:44 PM, Dotan Cohen <dotancohen@gmail.com> wrote: >> Try this (untested): >> >> class C: >> @staticmethod >> def foo(): >> pass >> >> 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. > I hadn't tested, I'm at work far from Idle. Just shooting from the hip. For that matter, though, this does work in Java (I'm pretty sure but again, untested right now). -- Dotan Cohen http://gibberish.co.il http://what-is-what.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
staticmethod makes my brain hurt Roy Smith <roy@panix.com> - 2011-11-16 21:30 -0500
Re: staticmethod makes my brain hurt alex23 <wuwei23@gmail.com> - 2011-11-16 18:44 -0800
Re: staticmethod makes my brain hurt Roy Smith <roy@panix.com> - 2011-11-16 21:52 -0500
Re: staticmethod makes my brain hurt Ethan Furman <ethan@stoneleaf.us> - 2011-11-16 19:24 -0800
Re: staticmethod makes my brain hurt alex23 <wuwei23@gmail.com> - 2011-11-17 18:31 -0800
Re: staticmethod makes my brain hurt Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-11-17 04:43 +0000
Re: staticmethod makes my brain hurt Roy Smith <roy@panix.com> - 2011-11-17 00:26 -0500
Re: staticmethod makes my brain hurt Devin Jeanpierre <jeanpierreda@gmail.com> - 2011-11-17 01:20 -0500
Re: staticmethod makes my brain hurt Dotan Cohen <dotancohen@gmail.com> - 2011-11-17 08:44 +0200
Re: staticmethod makes my brain hurt Ian Kelly <ian.g.kelly@gmail.com> - 2011-11-17 00:37 -0700
Re: staticmethod makes my brain hurt Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-11-17 10:17 +0100
Re: staticmethod makes my brain hurt Dotan Cohen <dotancohen@gmail.com> - 2011-11-17 13:13 +0200
Re: staticmethod makes my brain hurt Chris Angelico <rosuav@gmail.com> - 2011-11-17 22:38 +1100
csiph-web