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

2014年2月22日 04:24:07 -0800

On 2/22/2014 6:27 AM, Antoine Pitrou wrote:
> On 2014年2月22日 22:13:58 +1100
> Chris Angelico <[email protected]> wrote:
>> Lib/inspect.py:1350:
>> return sys._getframe(1) if hasattr(sys, "_getframe") else None
>> becomes
>> return (sys._getframe(1) except AttributeError: None)
> 
> May hide a bug if sys._getframe(1) itself raises AttributeError.
return (sys._getframe except AttributeError: lambda i: None)(1)
Assuming I have the syntax correct, and the bindings work this way, of
course.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to