Message from discussion
[Python-checkins] peps: Add PEP 422: Dynamic Class Decorators
Received: by 10.216.134.217 with SMTP id s67mr4541644wei.4.1338931953772;
Tue, 05 Jun 2012 14:32:33 -0700 (PDT)
X-BeenThere: dev-python@googlegroups.com
Received: by 10.180.94.2 with SMTP id cy2ls1890879wib.1.gmail; Tue, 05 Jun
2012 14:32:33 -0700 (PDT)
Received: by 10.216.70.142 with SMTP id p14mr4533757wed.7.1338931953558;
Tue, 05 Jun 2012 14:32:33 -0700 (PDT)
Received: by 10.216.70.142 with SMTP id p14mr4533756wed.7.1338931953534;
Tue, 05 Jun 2012 14:32:33 -0700 (PDT)
Return-Path: <python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org>
Received: from mail.python.org (mail.python.org. [82.94.164.166])
by gmr-mx.google.com with ESMTPS id ei10si32297wid.0.2012.06.05.14.32.33
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 05 Jun 2012 14:32:33 -0700 (PDT)
Received-SPF: pass (google.com: domain of python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org designates 82.94.164.166 as permitted sender) client-ip=82.94.164.166;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org designates 82.94.164.166 as permitted sender) smtp.mail=python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org; dkim=pass header...@python.org
Received: from albatross.python.org (localhost [127.0.0.1])
by mail.python.org (Postfix) with ESMTP id 3W6R7P2VBszNDn
for <dev-python+garchive-30976@googlegroups.com>; Tue, 5 Jun 2012 23:32:33 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901;
t=1338931953; bh=2qCTapcw7uN2GioHGGr1TLHsrqr7QYCj6ogHFQlLtqk=;
h=Date:From:To:Message-ID:References:MIME-Version:In-Reply-To:
Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:
List-Subscribe:Content-Type:Content-Transfer-Encoding:Sender;
b=CtA28DmjZP2ezRVw2H3+biLK49prI7i8SZOC2MqCV6gytPCTDdTXWZ4+whbtrKfho
8elYxUxnVA6BzDVH1l0W8FnlvcXvzDrLBCImatqjjlZt1IRGd7XNNYJYv30v85zs7Q
ZxukXXjMHwVXeLUOx/2CZ/faaFsCuZD9lJeHR9io=
X-Original-To: python-...@python.org
Delivered-To: python-...@mail.python.org
Received: from albatross.python.org (localhost [127.0.0.1])
by mail.python.org (Postfix) with ESMTP id 3W6R5X1RwqzNDH
for <python-...@python.org>; Tue, 5 Jun 2012 23:30:56 +0200 (CEST)
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:: [': 0.04;
'subject:Python': 0.05; 'attribute': 0.07; 'pep': 0.09; 'terry':
0.09; 'used.': 0.09; '+1.': 0.16; 'idea:': 0.16; 'reedy': 0.16;
'reversing': 0.16; 'subject: \n ': 0.16; 'subject:Add': 0.16;
'subject:PEP': 0.16; 'subject:] [': 0.16; 'wrote:': 0.17;
'subject:] ': 0.19; 'decorators': 0.22; 'equivalent': 0.23;
'header:In-Reply-To:1': 0.23; 'pass': 0.25; 'header:User-Agent:1':
0.26; 'seems': 0.28; 'skip:[ 10': 0.28; 'class': 0.30; 'am,':
0.30; 'skip:_ 10': 0.31; 'correct': 0.33; 'skip:@ 10': 0.33;
'another': 0.35; 'should': 0.35; 'add': 0.35; 'list': 0.35;
'charset:us-ascii': 0.36; 'but': 0.36; 'subject:: ': 0.37;
'store': 0.38; 'to:addr:python.org': 0.39; 'too': 0.39; 'content-
disposition:inline': 0.61; 'to:addr:python-dev': 0.61; 'of:':
0.66; 'received:62': 0.66; 'received:pl': 0.67; 'making': 0.67;
'indirect': 0.84; 'subject:Class': 0.91; '***': 0.93
Received: from localhost (HELO mail.python.org) (127.0.0.1)
by albatross.python.org with SMTP; 05 Jun 2012 23:30:56 +0200
Received: from filifionka.chopin.edu.pl (suita.chopin.edu.pl
[IPv6:2a00:1488:81::2]) by mail.python.org (Postfix) with ESMTP
for <python-...@python.org>; Tue, 5 Jun 2012 23:30:56 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by filifionka.chopin.edu.pl (Postfix) with ESMTP id 0FB2D2F62C
for <python-...@python.org>; Tue, 5 Jun 2012 23:30:55 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=chopin.edu.pl; h=
user-agent:in-reply-to:content-disposition:content-type
:content-type:mime-version:references:message-id:subject:subject
:from:from:date:date:received:received:received; s=suita; t=
1338931839; x=1340746240; bh=94KRjaWXvGTpRVZzyLsGVm2+vxwM0iJtnbL
qvZI0cK4=; b=Rvtu19xo8wEjF2vdGJIPWg8yOQN7tjYdc29AIjmL+2xLtgRtawT
VtagOuEIXBi0jd+ZJlbSAFtTeFO43X+xSz62v0w/tse9mPgrbDPVZ72fzH4uIUbj
pi5438ubkLk1bWbatkuWvNaZ0z9ut1quRbL5C5STrpflj92auskcGEEM=
X-Virus-Scanned: amavisd-new at chopin.edu.pl
Received: from filifionka.chopin.edu.pl ([127.0.0.1])
by localhost (filifionka.chopin.edu.pl [127.0.0.1]) (amavisd-new,
port 10024) with LMTP id SffvrlSyFBS9 for <python-...@python.org>;
Tue, 5 Jun 2012 23:30:39 +0200 (CEST)
Received: from jerzozwiesz.localdomain (unknown [62.121.72.3])
(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by filifionka.chopin.edu.pl (Postfix) with ESMTPSA id 6AB1928E67
for <python-...@python.org>; Tue, 5 Jun 2012 23:30:39 +0200 (CEST)
Received: by jerzozwiesz.localdomain (Postfix, from userid 1000)
id EAF0B240A52; Tue, 5 Jun 2012 23:30:38 +0200 (CEST)
Date: Tue, 5 Jun 2012 23:30:38 +0200
From: Jan Kaliszewski <z...@chopin.edu.pl>
To: python-...@python.org
Message-ID: <20120605213038.GA1...@chopin.edu.pl>
References: <E1SbsZw-0003dn...@dinsdale.python.org> <4FCE36FE.3080...@udel.edu>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4FCE36FE.3080...@udel.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
Subject: Re: [Python-Dev] [Python-checkins] peps: Add PEP 422: Dynamic Class
Decorators
X-BeenThere: python-...@python.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Python core developers <python-dev.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/options/python-dev>,
<mailto:python-dev-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-dev>
List-Post: <mailto:python-...@python.org>
List-Help: <mailto:python-dev-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-dev>,
<mailto:python-dev-requ...@python.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org
Errors-To: python-dev-bounces+dev-python+garchive-30976=googlegroups....@python.org
Terry Reedy dixit (2012-06-05, 12:42):
> On 6/5/2012 8:09 AM, nick.coghlan wrote:
>
> > Add PEP 422: Dynamic Class Decorators
[snip]
> >+So too will the following be roughly equivalent (aside from inheritance)::
> >+
> >+ class C:
> >+ __decorators__ = [deco2, deco1]
>
> I think you should just store the decorators in the correct order of use
> + __decorators__ = [deco1, deco2]
> and avoid the nonsense (time-waste) of making an indirect copy via
> list_iterator and reversing it each time the attribute is used.
+1. For @-syntax the inverted order seems to be somehow natural. But I
feel the list order should not mimic that...
***
Another idea: what about...
@@dynamic_deco2
@@dynamic_deco1
class C:
pass
...being an equivalent of:
class C:
__decorators__ = [dynamic_deco1, dynamic_deco2]
...as well as of:
@@dynamic_deco2
class C:
__decorators__ = [dynamic_deco1]
?
Cheers.
*j
_______________________________________________
Python-Dev mailing list
Python-...@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/dev-python%2Bgarchive-30976%40googlegroups.com