Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Closed
Description
Bug report
Consider the following example:
importinspectclassModel:a=1classModel:a=2print(Model.a)#> 2print(inspect.getsource(Model))#> class Model:#> a = 1
I think we should expect the last class to be used (it works as expected if we use functions instead of classes).
This issue was raised in an external project:
And I'm facing this issue while working on:
Let me know if this should be fixed, I'll take a deeper look at what was done in#10307 and see if I can make a PR
Your environment
- CPython versions tested on: 3.11.4
- Operating system and architecture: Ubuntu