Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

python's syntax is whitespace-sensitive and doesn't have curly braces around blocks

they did finally add assignments in expressions and conditional expressions, but every time i show a list comprehension to a java programmer they glaze over

so i guess some weird syntax is okay



> python's syntax is whitespace-sensitive and doesn't have curly braces around blocks

That's a good thing.


Not if you want to try out a copy fragment by copying it from editor into REPL.


jupyter solves this, but also you can prefix it with

    if 1:
and remove all its internal blank lines and add a blank line after it


More tedious editing when I just want to quickly try out a short code fragment. Perfect solution! So pythonic and full of "zen".


i didn't say it was a bad thing

my comment makes no sense if you read it assuming i think it's a bad thing

what it is is a weird thing


i thought you were being ironic with your own unique english syntax

but then i checked all your comments and sure enough it is pythonic english

weird syntax is okay and some punctuation may be redundant but it sure makes life easier for the eye


> they did finally add assignments in expressions and conditional expressions

Consitional expressions were added in Python 2.5 in 2006.


yes, after fifteen years

assignment in expressions took even longer


How are python list comprehension in any way more weird than Java streams?


java streams don't exist in java syntax

we were talking about weird syntax, not weird semantics


List compréhensions exist in so many languages. Are we talking those "Java" programmers who only ever coded in Java?


who cares about what java programmers think lol whatever they like should be treated with extreme suspicion

> python's syntax is whitespace-sensitive and doesn't have curly braces around blocks

that's a plus. the proof is in the pudding. one language has exploded. others haven't. the end.


i didn't say it was a bad thing

my comment makes no sense if you read it assuming i think it's a bad thing

what it is is a weird thing




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: