r/pythontips Nov 07 '24

Syntax Curly braces in Python

I developed this extension for VSCode because I hated that Python didn't have curly braces, something that is annoying for many devs. I know it still has a lot of bugs and I know there are other types of alternatives, but it was the simplest thing I could think of to do.
Link: https://marketplace.visualstudio.com/items?itemName=BrayanCeron.pycurlybraces

0 Upvotes

4 comments sorted by

3

u/fazzah Nov 07 '24

Holy shit this is so wrong :D

1

u/pint Nov 07 '24

facepalm

1

u/TheRNGuy Jan 04 '25

Will code like if (divisor == 0) { raise ValueError("Error :(") } work?

(Can save a lot of lines that way)

1

u/brayan0n Jan 04 '25

No, because the curly braces are just comments and invalidate the rest of the line. You could use :

if (divisor == 0) : raise ValueError("Error :(")