Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17547
| References | <CAN1F8qWV1j-2VDvMyh47dxfj4G_yXSP8rcUdmpBY-HLrD5gaUQ@mail.gmail.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2011-12-19 20:46 -0700 |
| Subject | Re: Grammar for classes |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3846.1324352821.27778.python-list@python.org> (permalink) |
On Mon, Dec 19, 2011 at 6:34 PM, Joshua Landau <joshua.landau.ws@gmail.com> wrote: > In reading thorough the syntax defined in the reference, the class statement > has surprised me. > > It says that the inheritance part of the class can accept comprehensions. > What does this mean? > I've tried: > "class A(x for x in ()): pass" > but this doesn't need the extra clause as "x for x in ()" is an expression, > and thus this evaluates: > "class A(x for x in (),): pass" > although again it won't be a valid class anytime soon. > > So what is this clause for? That's new to me as well. There's nothing about it in PEP 3115. I suspect it's a bad copy-and-paste from the function call syntax.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Grammar for classes Ian Kelly <ian.g.kelly@gmail.com> - 2011-12-19 20:46 -0700
csiph-web