[New-bugs-announce] [issue40317] inspect.getsource() examines incorrect target

Grzegorz Krasoń report at bugs.python.org
Sat Apr 18 07:50:37 EDT 2020


New submission from Grzegorz Krasoń <grzegorz.krason at gmail.com>:

Based on the attached example:

Expected output:
```
123
    class Number:
        payload = 123

321
    class Number:
        payload = 321
```

Actual output:
```
123
    class Number:
        payload = 123

321
    class Number:
        payload = 123
```

Reproduced using:

* Python 2.7.17
* Python 3.7.7
* Python 3.8.2

----------
components: Library (Lib)
files: demo.py
messages: 366701
nosy: Grzegorz Krasoń
priority: normal
severity: normal
status: open
title: inspect.getsource() examines incorrect target
type: behavior
versions: Python 2.7, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file49072/demo.py

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


More information about the New-bugs-announce mailing list