Message83611
> If we allow this, how many of the following will be allowed?
> if expr as name: <block>
> while expr as name: <block>
> expr as name # alternative to "name = expr"
This patch implements your final point:
expr as name (albeit with a nominal '->' RARROW rather than 'as')
the patch creates a new expression, assexp (assignment expression)
there is no need to implement this for countless other
if/while/for because
they accept expressions and this assignment is an expression.
(Note it is a patch for a different behaviour than the OP suggested.)
> As for using "->", please no, there are plenty of languages that use
> line noise, but Python doesn't need to be one of them.
I have begun a discussion about this on python-ideas to give it some
air as suggested by Raymond. We can always close the issue as 'wont fix'
if it doesn't get off the ground.
This issue (although addressing an old concern dating back
to the beginning of python) has been sitting unloved for 9 or so months
and I felt that we should at least resolve it.
Cheers,
Jervis |
|
Date |
User |
Action |
Args |
2009-03-15 00:42:53 | jdwhitley | set | recipients:
+ jdwhitley, georg.brandl, rhettinger, k0wax, steven.daprano |
2009-03-15 00:42:52 | jdwhitley | set | messageid: <1237077772.33.0.836178281489.issue1714448@psf.upfronthosting.co.za> |
2009-03-15 00:42:50 | jdwhitley | link | issue1714448 messages |
2009-03-15 00:42:48 | jdwhitley | create | |
|