[Python-ideas] Debugging: some problems and possible solutions

Anders Hovmöller boxed at killingar.net
Wed Oct 3 11:42:30 EDT 2018


TITLE: output debug information easily and quickly

POSSIBLE SOLUTION

Short form of keyword arguments where

foo(=a, =1+bar)

Is expanded at compile time to

foo(**{'a': a, '1+bar': 1+bar})

Then we can just create a normal debug function:

def debug_print(**vars):
    for k, v in vars.items():
        print(f'{k}={v}')

this is of course useful for many other things as Steven has pointed out. 

/ Anders 


More information about the Python-ideas mailing list