[issue34880] About the "assert" bytecode

thautwarm report at bugs.python.org
Tue Oct 9 12:57:08 EDT 2018


thautwarm <yaoxiansamma at gmail.com> added the comment:

Hi, Serhiy, there could be an another way to fix all this sort of problems IMO.

We can figure out all the cases that implicitly require shadow builtins, and then change symtable visitor to add corresponding free variables with name mangling, for instance:

1. implicitly add free variable ".AssertionError"

```
def f():
   assert 1
```

where ".AssertionError" is a name-mangled free variable and is assigned once the module is executed.

The same to `StopAsyncIteration`, `TypeError`,  `__build_class__` and so on.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34880>
_______________________________________


More information about the Python-bugs-list mailing list