This is about Pycharm 4.5.1.
Whenever I stop at a breakpoint in a function I cannot overwrite or create any variables defined in the function in the interactive python console (regardless of whether these function variables are defined before or after the breakpoint).
By contrast, when my debugging point is not within a function, I can overwrite any variables defined within the current script. Is that a bug or intended behavior? Anyway it drives me crazy, because it makes any interactive break-point-guided developing almost impossible.
My question: Is there any way to get around this annoying behavior in Pycharm?
MINIMAL EXAMPLES
>>> refers to my input at the interactive debugging console, once I reached the indicated breakpoint.
This works:
a = 3 # <- put breakpoint here
>>> a = 4
>>> a
Out[7]: 4
This works:
def test():
a = 3 # <- put breakpoint here
test()
>>> b = 4
>>> b
Out[7]: 4
This does not work:
def test():
a = 3 # <- put breakpoint here
test()
>>> a = 4
>>> a
Traceback (most recent call last):
File "/redacted/local/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 3035, in run_code exec(code_obj, self.user_global_ns, self.user_ns)
File "< ipython-input-5-5cd59f58ac08>", line 1, in < module>
a
NameError: name 'a' is not defined
This does not work:
def test():
a = 3
print('just for the sake of placing a breakpoint') # <- put breakpoint here
test()
>>> a = 4
>>> a
Out[7]: 3