watchpoints
python-varname
watchpoints | python-varname | |
---|---|---|
7 | 2 | |
462 | 300 | |
- | - | |
1.5 | 5.6 | |
about 1 year ago | 1 day ago | |
Python | Python | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
watchpoints
-
What a good debugger can do
It's sad that Python does not really support some of these debugging methods.
E.g. you cannot really watch variable changes. There are some workarounds, like writing a custom __setattr__ or __setattribute__ in case of an object, or checking all STORE_* operations. https://youtrack.jetbrains.com/issue/PY-30387 https://github.com/gaogaotiantian/watchpoints
Reverse debugging is also sth I would like to have, and there are a few projects to support this, but it's not really well supported in standard CPython. https://foss.heptapod.net/pypy/revdb https://pytrace.com/
-
Is there a tool to run code and AFTER that look at execution step by step.
There is also the watchpoints module to track changes to variables, but I don't think you can use the two of them together since they both use the same underlying callback in Python.
- Watchpoints - an easy-to-use, intuitive variable/object monitor tool for Python that behaves similar to watchpoints in gdb.
-
Show HN: Watchpoints, an easy to use watchpoints equivalent library for Python
It uses Python's built-in inspect module to get the caller frame. https://github.com/gaogaotiantian/watchpoints/blob/68bc13716...
It then uses sys.settrace (which is intended as an interface for debuggers) to step through the code and check whether the variable has been changed. Documentation on sys.settrace: https://docs.python.org/3/library/sys.html#sys.settrace
Python exposes most of its guts as part of the standard library, making clever hacks like this possible.
python-varname
-
If variable "y" within function F(x,y) calls to function G(z), is there any way to get the name of that variable within function G?
# https://old.reddit.com/r/learnpython/comments/vx8kw0/if_variable_y_within_function_fxy_calls_to/ # Qackydontus.py # https://github.com/pwwang/python-varname # python -m pip install varname from varname import argname def G(z): Name = argname('z') return z, Name def F(x, y): return x, G(y) print(F(1, 2)) # (1, (2, 'y'))
-
How do I print a word entered in a function parameter?
That's possible, but complicated. See this package
What are some alternatives?
flow-storm-debugger - A debugger for Clojure and ClojureScript with some unique features.
PINCE - Reverse engineering tool for linux games
debug-adapter-protocol - Defines a common protocol for debug adapters.
Nameof C++ - Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
grub2-theme-preview - :city_sunrise: Preview a full GRUB 2.x theme (or just a background image) using KVM / QEMU
electron-inject - Inject javascript into closed source electron applications e.g. to enable developer tools for debugging.
rr - Record and Replay Framework
icecream - 🍦 Never use print() to debug again.
spdlog - Fast C++ logging library.
mkdocs-markdownextradata-plugin - A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template
delve - Delve is a debugger for the Go programming language.