A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-October/155418.html below:

[Python-Dev] Should assert continue to do a LOAD_GLOBAL on AssertionError?

[Python-Dev] Should assert continue to do a LOAD_GLOBAL on AssertionError? [Python-Dev] Should assert continue to do a LOAD_GLOBAL on AssertionError?Antoine Pitrou solipsis at pitrou.net
Wed Oct 3 14:09:42 EDT 2018
On Thu, 4 Oct 2018 01:59:37 +1000
Steven D'Aprano <steve at pearwood.info> wrote:
> On the bug tracker, there's a discussion about the current behaviour of 
> the assert statement, where shadowing AssertionError will change the 
> behaviour of the assertion.
> 
> https://bugs.python.org/issue34880
> 
> Currently, assert does a LOAD_GLOBAL on AssertionError, which means if 
> you shadow the name, you get a different exception. This behaviour goes 
> back to Python 1.5.
> 
> I'm looking for guidance here, is this the intended behaviour, or an 
> accident? Should it be changed to better match other builtins?

I would make it an implementation detail myself, i.e. any
implementation is free to make it work as it prefers.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4