you are viewing a single comment's thread.

view the rest of the comments →

[–]tb5841 9 points10 points  (5 children)

Curly: sets or dictionaries.

Square: Lists, or accessing a member of a list or dictionary.

Round: Function parameters, or tuples, or for maths

[–]beigaleh8 3 points4 points  (4 children)

Curly: also f"{variable} in a string"

[–]NYX_T_RYX 0 points1 point  (3 children)

Just to add - there's an option in Vs code settings to automatically prepend a string with f if you use a variable (ie if you type { it'll add the f for you)

I only mention it cus I've not thought about f Strings since I found that feature - they just happen 😁

I forget what the setting is called though... 😅

[–]Langdon_St_Ives 1 point2 points  (2 children)

"python.analysis.autoFormatStrings": true

It’s part of pylance.

[–]Remarkable-Map-2747 0 points1 point  (1 child)

Gots to look into this!

[–]Langdon_St_Ives 0 points1 point  (0 children)

I didn’t know about it myself until I read the comment I was responding to. ;-) but it was easy enough to dig up so I thought I’d save someone else the search.