19.05.22 09:45, nadav.mis...@gmail.com пише:
Awesome! never seen this syntax used before and the above libraries are not
using it.
Can you elaborate on the else part ? Why is it needed for the syntax to be
correct and could you put any expression in the parenthesis ?
https://docs.python.org/3/reference/expressions.html#conditional-expressions
The tricky part is that isinstance(obj, ()) and issubclass(cls, ()), and
corresponding internal check used in the `except ()` clause always
return False. It is not explicitly stated (unlike to all() and any()),
but it follows from the description if you read it carefully.
_______________________________________________
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/2UCAKNAZ2BHA5DIHDZMA3HKX2CZXQMWC/
Code of Conduct: http://python.org/psf/codeofconduct/