tessl install tessl/pypi-varname@0.15.0Dark magics about variable names in python
Agent Success
Agent success rate when using this tile
90%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.41x
Baseline
Agent success rate without this tile
64%
A utility that provides enhanced debugging output for variables and expressions during development.
count and value 42 in format "DEBUG: count=42" @testname (value "Alice") and age (value 30) on separate lines @testx with value 10 using custom prefix "LOG: " instead of default prefix @testa (value 1) and b (value 2) merged on a single line @testx + y (where x=5 and y=3) showing both the expression source "x + y" and its result @test@generates
def debug_print(var, *more_vars, prefix="DEBUG: ", merge=False, show_expressions=False):
"""
Print variables with their names and values for debugging purposes.
Args:
var: The first variable to print
*more_vars: Additional variables to print
prefix: String prefix for each debug line (default: "DEBUG: ")
merge: If True, print all variables on one line; if False, print on separate lines
show_expressions: If True, show full expression source code instead of just variable names
The function prints to stdout in the format:
- Single variable: "{prefix}{var_name}={var_value}"
- Multiple variables (merge=False): Each on separate line
- Multiple variables (merge=True): "{prefix}{var1_name}={var1_value}, {var2_name}={var2_value}"
- With show_expressions=True: Shows full expression like "x + y=8" instead of just "x=5"
"""
passProvides variable name and expression introspection capabilities for Python.
@satisfied-by