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

2018-10-05 Thread Brett Cannon
On Wed, 3 Oct 2018 at 19:39, Benjamin Peterson wrote: > > > On Wed, Oct 3, 2018, at 08:59, Steven D'Aprano 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. >

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

2018-10-03 Thread Benjamin Peterson
On Wed, Oct 3, 2018, at 08:59, Steven D'Aprano 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 do

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

2018-10-03 Thread Antoine Pitrou
On Thu, 4 Oct 2018 01:59:37 +1000 Steven D'Aprano 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 d

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

2018-10-03 Thread Guido van Rossum
Feels like an accident to me. Generally syntactic constructs should be unaffected by what's in any namespace except when the override is intentional (e.g. __import__). On Wed, Oct 3, 2018 at 9:02 AM Steven D'Aprano wrote: > On the bug tracker, there's a discussion about the current behaviour of

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

2018-10-03 Thread Steven D'Aprano
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