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-June/054043.html below:

[Python-Dev] PEP 343 rewrite complete

[Python-Dev] PEP 343 rewrite complete [Python-Dev] PEP 343 rewrite completeEric Nieuwland eric.nieuwland at xs4all.nl
Wed Jun 1 20:46:20 CEST 2005
Nice going! But ...

Could we extend the 'try' syntax for this instead of introducing 
'with'? If I look at the translation it an augmented 'try'.
	with EXPR as VAR:
		BLOCK1
	except EXCEPTION:
		BLOCK2
could then be translated to
	abc = EXPR
	exc = (None, None, None)
	VAR = abc.__enter__()
	try:
		try:
			BLOCK1
		except EXCEPTION:
			BLOCK2
		except:
			exc = sys.exc_info()
			raise
	finally:
		abc.__exit__(*exc)


Can the 'throw()' method be renamed 'raise()'? IMHO that makes much 
clearer what happens.

Same thing with 'GeneratorExit', 'StopGeneration' more closely matches 
'StopIteration'.

--eric

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