Daniel Moisset writes: > For the likely rare situation where I'd want to do this rather than > refactoring into a function, I might try with something like this without > requiring changes to the language:
> @contextmanager > def breakable(): Of course this doesn't address Serhiy's case where he cares about the performance hit of the try, but it sure looks nicer than some of the other alternatives! _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/W73VBWL3AHUT4Y7MMD6HHJTIYTNKBQZC/ Code of Conduct: http://python.org/psf/codeofconduct/
