[ Senra ]:
> > [ Guido ]:
> > > 1. Decide on a keyword to use, if any.
> >
> > Shouldn't be the other way around ?
> > Decide to use *no* keyword, if that could be avoided.
[ Reinhold ]:
> There is one problem with using no keyword: You cannot use arbitrary
> expressions
> in the new statement. Consider:
>
> resource = opening("file.txt")
> block resource:
> (...)
>
> resource = opening("file.txt")
> resource:
> (...)
>
> The latter would have to be forbidden.
I'm not quite sure why, but there seem to be a
workaround (forseen in PEP 340). And people seem
to be "using" this already <0.5 wink>:
[Alex Martelli]:
> for name in filenames:
> opening(name) as f:
> if f.read(2) == 0xFEB0: break
Moreover, an anonymous block should have
no <<name>> (neither 'block', 'with', 'using')
to be true anonymous <1.0-Tim-Peter'ly wink>
cheers,
Senra
--
Rodrigo Senra
--
MSc Computer Engineer rodsenra(at)gpr.com.br
GPr Sistemas Ltda http://www.gpr.com.br/
Personal Blog http://rodsenra.blogspot.com/
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com