[Python-Dev] PEP 463: Exception-catching expressions

Antoine Pitrou solipsis at pitrou.net
Sat Feb 22 10:58:29 CET 2014


On Sat, 22 Feb 2014 20:29:27 +1100
Chris Angelico <rosuav at gmail.com> wrote:
> 
> Which means that, fundamentally, EAFP is the way to do it. So if PEP
> 463 expressions had existed from the beginning, hasattr() probably
> wouldn't have been written - people would just use an
> except-expression instead.

Really? hasattr() is much easier to write than the corresponding
except-expression.

Regards

Antoine.




More information about the Python-Dev mailing list