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/2009-March/087249.html below:

[Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body

[Python-Dev] PEP 377 - allow __enter__() methods to skip the statement body"Martin v. Löwis" martin at v.loewis.de
Mon Mar 16 01:37:53 CET 2009
> Well, StopIteration is still an implementation detail that only
> occasionally bleeds through to actual programming. It says nothing about
> whether using exceptions for non-exceptional circumstances (control
> flow) is good practise. Personally I think it makes the intent of code
> less easy to understand - in effect the exceptions *are* being used as a
> goto.

The same can be said about if statements and while loops - they are also
being used "as gotos". The bad thing about the goto statement is that it
allows arbitrary, unstructured control flow. This is unlike if
statements, while loops, and - yes - exceptions. They all provide for
structured control flow. raise, in particular, is no more evil than
break, continue, return, or yield.

Regards,
Martin
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