[Python-ideas] with-statement syntactic quirk
eliben at gmail.com
Wed Oct 31 13:33:04 CET 2012
On Wed, Oct 31, 2012 at 5:17 AM, Devin Jeanpierre <jeanpierreda at gmail.com>wrote:
> On Wed, Oct 31, 2012 at 6:38 AM, Barry Warsaw <barry at python.org> wrote:
> > This seems analogous to using parens to wrap long if-statements, but
> > there's some subtle corner of the grammar that makes this problematic
> > 'with' treating the whole thing as a single context manager).
> This seemed kind of icky when I read it, and I think Nick Coghlan
> stated the reason best.
> Is there a reason the tokenizer can't ignore newlines and
> indentation/deindentation between with/etc. and the trailing colon?
> This would solve the problem in general, without ambiguous syntax.
At the expense of making the tokenizer context dependent?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas