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


Groups > comp.lang.python > #25511

Re: Style question: metaclass self vs cls?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.084
X-Spam-Evidence '*H*': 0.84; '*S*': 0.00; 'parameter': 0.07; 'subject:question': 0.08; 'methods,': 0.09; 'elf': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'class.': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'race,': 0.29; 'steven': 0.29; 'maybe': 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'jul': 0.65; 'you:': 0.75; '1st': 0.81; 'subject:self': 0.84; 'to:name:python': 0.84; 'edition': 0.86
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=cx/FcDa9HmBz66y5ZuUaBzKbjrRpvApQqGphaO38JWE=; b=UfBnD4QpedDFf+0gPKNNRUfSYDLkOpN5eycQGjEOlutVEUmeWmPoTmk9copawO9uFP M/W4rD06QMBn0o/fn0Uc5bJP6rSL+NX4/SEhzeJWHMp6x2Q1F/O7V9H3qwAXelf9X+Gp 2hx8b/zHQ6/T5HsqOJQdQzcGKpLWLgVZjq/GmSrylGA0N7X6CRcchGIiXu5bzDL2h6ZS ToQpsq6h/ifUKZXX16Jf64QK02IJwLyHlKqavg1JZHayWx6gTcpAdJ+JXihy+HJL2hU7 H1xmPEE5qgZ6mgMNgBTuvTQRnRK7Gnwldixgvddo57phEo7ODQlGdVAaf/Pg0OhKYiEO gUOA==
MIME-Version 1.0
In-Reply-To <8f38a814-3c6c-42d3-8d7b-d7d8ae33d06e@x6g2000pbh.googlegroups.com>
References <50043377$0$29978$c3e8da3$5496439d@news.astraweb.com> <8f38a814-3c6c-42d3-8d7b-d7d8ae33d06e@x6g2000pbh.googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 17 Jul 2012 10:35:00 -0600
Subject Re: Style question: metaclass self vs cls?
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
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.2227.1342542933.4697.python-list@python.org> (permalink)
Lines 9
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342542933 news.xs4all.nl 6984 [2001:888:2000:d::a6]:53348
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25511

Show key headers only | View raw


On Tue, Jul 17, 2012 at 12:10 AM, alex23 <wuwei23@gmail.com> wrote:
> On Jul 17, 1:29 am, Steven D'Aprano <steve
> +comp.lang.pyt...@pearwood.info> wrote:
>> Here's a style question for you: in a metaclass, what should I call the
>> instance parameter of methods, "cls" or "self"?
>
> Maybe portmanteu it as "clasself"? :)

What is this, 1st edition D&D?  Elf is a race, not a class.

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


Thread

Style question: metaclass self vs cls? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-16 15:29 +0000
  Re: Style question: metaclass self vs cls? Terry Reedy <tjreedy@udel.edu> - 2012-07-16 18:21 -0400
  Re: Style question: metaclass self vs cls? alex23 <wuwei23@gmail.com> - 2012-07-16 23:10 -0700
    Re: Style question: metaclass self vs cls? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-17 10:35 -0600
  Re: Style question: metaclass self vs cls? Michele Simionato <michele.simionato@gmail.com> - 2012-07-17 05:23 -0700
    Re: Style question: metaclass self vs cls? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-17 10:34 -0600
    Re: Style question: metaclass self vs cls? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-18 02:50 +0000

csiph-web