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/2007-April/072490.html below:

[Python-Dev] context manager - generator interaction?

[Python-Dev] context manager - generator interaction? [Python-Dev] context manager - generator interaction?Raymond Hettinger python at rcn.com
Fri Apr 6 07:18:23 CEST 2007
> Guido van Rossum wrote:
>> Isn't this violating the rule that a try/except should only enclose
>> the smallest expression where the exception is expected?
> 
> Yeah, and I keep finding myself wanting to hyperlink to that "rule" in
> the official docs, but it only seems to be written down in developer's
> heads. Can we get that into the Language Ref somewhere? Maybe on the
> http://docs.python.org/ref/try.html page?

I'll add a snippet to the tutorial with advice on try/except.

I don't think it should go in the main documentation because it is
really more of a suggestion or technique than an actual rule.
Also, there are plenty of other situations where the "rule" doesn't apply.


Raymond
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