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


Groups > comp.lang.python > #17763

Re: Grammar for classes

References <CAN1F8qWV1j-2VDvMyh47dxfj4G_yXSP8rcUdmpBY-HLrD5gaUQ@mail.gmail.com> <jcppjc$va7$1@dough.gmane.org> <CAN1F8qXjE0zPrUjC-Kih=gCm=pv4mwGPCvT+Y5EE3XVwVw3WwA@mail.gmail.com> <jd0f48$fdv$1@dough.gmane.org>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-12-22 18:27 -0700
Subject Re: Grammar for classes
Newsgroups comp.lang.python
Message-ID <mailman.4009.1324603713.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Dec 22, 2011 at 4:39 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> Beats me. The 2.7 doc says inheritance ::=  "(" [expression_list] ")" and I
> no on no 3.x change/addition.

Well, there is one change in 3.x which is that the inheritance list
now accepts keyword parameters (PEP 3115) -- the "metaclass" keyword
specifies the metaclass instead of using a bogus __metaclass__
attribute, and any other keywords are passed along to the metaclass.
That's why the parsing of the inheritance list was generalized to look
more like a function call, but it doesn't explain why the class
declaration might wish to receive a comprehension.

Cheers,
Ian

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


Thread

Re: Grammar for classes Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-22 18:27 -0700

csiph-web