18.05.22 22:08, Nadav Misgav пише:
I was thinking of a way to expand the current try-expect block to support condinitial expect block. I was imagining the new syntax as

try:
     expression block
expect Exception if condition
     expression block

where the expect expression block would only run if the condition is met else it would raise the exception, for example the following code

You already can do this!

try:
    expression block
expect Exception if condition else ():
    expression block

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/YH7A4GDAJYPG7EIRBCO5U2ESZ2IVYGUE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to