
3 Oct
2018
3 Oct
'18
8:42 a.m.
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