sirius-utility-nodes icon indicating copy to clipboard operation
sirius-utility-nodes copied to clipboard

Feature: Self-documenting variables for formatted print string

Open sk0g opened this issue 2 years ago • 0 comments

So currently when writing the print statements, you often have to print something like Actor received event {event}. Python's f-strings (linked) have a way around this, which I think would be applicable and useful here too.

In Python you can have a formatting string like Actor debug {velocity=}, which essentially expands to Actor debug velocity={velocity}. This would both keep the node size down, as well as provide a convenient shorthand for a 'labelled' variable.

I've tried the current behaviour, and while it exposes the var= pin, it doesn't seem to be able to print it out, and instead prints out the label itself.

https://docs.python.org/3/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging

sk0g avatar Jul 25 '22 02:07 sk0g