Issue1218234
Created on 2005-06-10 13:49 by sonderblade, last changed 2009-04-25 20:08 by ajaksu2.
|
msg60756 - (view) |
Author: Björn Lindqvist (sonderblade) |
Date: 2005-06-10 13:49 |
|
This is test.py:
def foo():
print "Bla"
And in an interactive session:
>>> import inspect, test
>>> test.foo()
Bla
>>> inspect.getsource(test.foo)
'def foo():\n print "Bla"\n'
Now I edit test.py to (without exiting the interactive
session):
def foo():
print "Oh no!"
>>> reload(test)
<module 'test' from 'test.py'>
>>> test.foo()
Oh no!
>>> inspect.getsource(test.foo)
'def foo():\n print "Bla"\n'
inspect should output the new source.
|
|
msg60757 - (view) |
Author: Georg Brandl (georg.brandl) |
Date: 2005-06-10 16:36 |
|
Logged In: YES
user_id=1188172
This is the fault of the linecache module which inspect
uses. It caches the file contents and does not reload it
accordingly. However, I assume it's pretty hard finding a
good solution to this.
|
|
msg62174 - (view) |
Author: Guilherme Polo (gpolo) |
Date: 2008-02-07 19:42 |
|
I'm attaching a patch. Is there some hidden problem that it may cause ?
By the way, this issue is a duplicate of http://bugs.python.org/issue993580
|
|
msg86540 - (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2009-04-25 19:38 |
|
Fix was committed to py3k but with no tests AFAIK. Here's a (failing)
test for trunk that runs OK after Guilherme's patch.
We might want to keep this behavior restricted for when the module was
reloaded.
|
|
msg86544 - (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2009-04-25 20:08 |
|
Er, no, it wasn't committed to py3k, it was just me getting my patches
mixed. Attaching the py3k test with relative import fixed.
|
|
| Date |
User |
Action |
Args |
| 2009-04-25 20:08:18 | ajaksu2 | set | files:
- test_inspect-py3k.diff |
| 2009-04-25 20:08:09 | ajaksu2 | set | files:
+ test_inspect-py3k2.diff
messages:
+ msg86544 |
| 2009-04-25 19:39:15 | ajaksu2 | set | files:
+ test_inspect-py3k.diff |
| 2009-04-25 19:38:32 | ajaksu2 | set | files:
+ test_inspect-trunk.diff
nosy:
+ ajaksu2 versions:
+ Python 2.6, Python 3.0, - Python 2.5 messages:
+ msg86540
keywords:
+ patch type: behavior stage: patch review |
| 2009-04-05 18:16:38 | georg.brandl | unlink | issue993580 dependencies |
| 2009-04-05 18:16:38 | georg.brandl | link | issue993580 superseder |
| 2009-03-04 15:13:21 | ajaksu2 | link | issue993580 dependencies |
| 2008-02-07 19:42:24 | gpolo | set | files:
+ inspect.py.diff nosy:
+ gpolo messages:
+ msg62174 |
| 2005-06-10 13:49:10 | sonderblade | create | |
|