watchpoints in PyCharm?

Is there any way to get watchpoints functionality? I mean breakpoint on variable changes.

3 comments

Conditional breakpoints may be the closest you can get, but they trigger when an expression evaluates to True.

I don't think conditionals support any arbitrary change in a variable though.

A temporary code hack I've used to achieve a break on an arbitrary change is to add a new variable that keeps track of the old value and then set the break-point condition to when the old and new don't match.

Semen wrote:

Is there any way to get watchpoints functionality? I mean breakpoint on variable changes.

Rob

0

conditional breakpoints are too far..

one of workarounds I can see - is to mask variable with descriptor and set breakpoint on setter.

but that mess the code and may cause issues with changed type (from attribute type to descriptor)

can't believe there're no watchpoints in python debugger.

http://bugs.python.org/issue5654

0

Hello,

Is there any way to get watchpoints functionality? I mean breakpoint

on variable changes.

There is no such feature in PyCharm at the moment (nor, as far as I understand,

in any of the other Python IDEs). As far as I understand, the only way it

can be implemented is by running your entire program in single-step mode

and evaluating the variable after every step, which would slow down the execution

drastically.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.