Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.05; 'subject:Python': 0.06; 'attribute': 0.07; 'level,': 0.07; 'parser': 0.07; 'cc:addr:python-list': 0.11; 'python': 0.11; 'assignments': 0.16; 'at.': 0.16; 'marco': 0.16; 'metaclass': 0.16; 'sees': 0.16; 'subject:class': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'occurs': 0.31; 'class': 0.32; 'another': 0.32; 'skip:d 20': 0.34; 'subject:the': 0.34; 'anywhere': 0.35; 'but': 0.35; 'received:google.com': 0.35; '+0200,': 0.36; 'level': 0.37; 'pm,': 0.38; 'sure': 0.39; 'full': 0.61; 'within': 0.65; 'body.': 0.68; 'answer:': 0.84; 'oscar': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xFzY7ZgDbWU921hHpPudTFAHzJxJCQ41jHNIDIIZp9w=; b=ClwFocHeG7r19lqfj2jW8Nq9zIB8TMtORuKaDHGJCAzpYlcQE1YFYdPq5AI8hIy1uD bmY6YPiH36lItzAfd0/Tsx+dmI9hzUOj94AifdWgYkkC0q8+vSUYFTtHvVNOo7ii8MuB nNpWO9iUdiYIs5aRN8AlnGvSUoQUIEUVZ4Jcjp9qRlem4F+iYDy+MLw2PTJEq0Efjlaj 1SjfkergZ/Yxuza4uBQOo0gOgnRaPeTvTldirrFQBoSC6m4RmlyOdWZeFiXZQPQA870u gQ9HkpoYVgNstiBh51hyYRViDyf3OO1AwhS9+igE4rNqjQ8Dkw4lBnrB1sCtN/XfXt0/ AoYw== MIME-Version: 1.0 X-Received: by 10.52.173.165 with SMTP id bl5mr2538548vdc.18.1381273214884; Tue, 08 Oct 2013 16:00:14 -0700 (PDT) In-Reply-To: <52540779$0$29984$c3e8da3$5496439d@news.astraweb.com> References: <52540779$0$29984$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 9 Oct 2013 00:00:14 +0100 Subject: Re: class-private names and the Zen of Python From: Oscar Benjamin To: "Steven D'Aprano" Content-Type: multipart/alternative; boundary=bcaec51b9cfd4fa26c04e842bbf1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381273223 news.xs4all.nl 15959 [2001:888:2000:d::a6]:35263 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56453 --bcaec51b9cfd4fa26c04e842bbf1 Content-Type: text/plain; charset=ISO-8859-1 On Oct 8, 2013 2:26 PM, "Steven D'Aprano" < steve+comp.lang.python@pearwood.info> wrote: > > On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote: > > > Another question is: where is the place in which this transformation > > occurs? Is it at the parser level, before the dictionary attribute is > > gave as argument to the metaclass? > > Good question! > > I don't have a full answer, but I have a part answer: it occurs before > the metaclass sees the namespace: > I thought it was at the parser level and applied to assignments at class level and attribute assignments anywhere within a class body. I'm pretty sure there's no way to control the behaviour from Python code if that's what the metaclass question is getting at. Oscar --bcaec51b9cfd4fa26c04e842bbf1 Content-Type: text/html; charset=ISO-8859-1


On Oct 8, 2013 2:26 PM, "Steven D&apos;Aprano" <steve+comp.lang.python@pearwood.info> wrote:
>
> On Tue, 08 Oct 2013 12:13:48 +0200, Marco Buttu wrote:
>
> > Another question is: where is the place in which this transformation
> > occurs? Is it at the parser level, before the dictionary attribute is
> > gave as argument to the metaclass?
>
> Good question!
>
> I don't have a full answer, but I have a part answer: it occurs before
> the metaclass sees the namespace:
>

I thought it was at the parser level and applied to assignments at class level and attribute assignments anywhere within a class body.

I'm pretty sure there's no way to control the behaviour from Python code if that's what the metaclass question is getting at.

Oscar

--bcaec51b9cfd4fa26c04e842bbf1--