[issue33401] `exec` attribute can't be set to objects in Python2 (SyntaxError)

luav report at bugs.python.org
Tue May 1 16:32:55 EDT 2018


New submission from luav <luardev at gmail.com>:

The following code works fine on Python 3.5.2 but `exec` attribute fails to be set to the object on Python 2.7.12:
```python
>>> o = type('O', (object,), {})
>>> o.e = 1
>>> o.eval = 1
>>> o.exec = 1
  File "<stdin>", line 1
    o.exec = 1
         ^
SyntaxError: invalid syntax
```

OS Environments:  Ubuntu 16.04.4 LTS x64

----------
components: Interpreter Core
messages: 316015
nosy: luav
priority: normal
severity: normal
status: open
title: `exec` attribute can't be set to objects in Python2 (SyntaxError)
type: behavior
versions: Python 2.7

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


More information about the Python-bugs-list mailing list