A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053337.html below:

[Python-Dev] PEP 340 -- loose ends

[Python-Dev] PEP 340 -- loose ends [Python-Dev] PEP 340 -- loose endsRodrigo Dias Arruda Senra rodsenra at gpr.com.br
Wed May 4 21:12:33 CEST 2005
[ 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/

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4