It's only about avoiding the ambiguity of js, it js in general.
I remember making a small webapp in flask and ajax. Most of the code is on the server, it's as little js as possible, and it has no js dependencies.
https://www.python.org/dev/peps/pep-0020/
I especially likes this one:
> There should be one-- and preferably only one --obvious way to do it.
It's true that the standard library is good, but generally I do more things with basic python than the base of other languages.
And honestly I've never understood how js prototypes work.
Python just feels better. The syntax is less cluttered. That's a huge point of python.
- sequence[start:finish:step]
- no need for "==="
- try/except with specific exceptions
- context managers
- yield from
- "in" on any iterable
- raise from
- every empty object is false, all other are true
- spread work on all iterables, not just arrays
- f"{2:03}", f"{2:.2f}" and f"{date:%m/%d/%Y}"
- / and //
- no need for variable declaration keywords
- 0b1111
- "else" in loops
- := makes for explicit assignation + comparison instead of a footgun
- None instead of null + undefined
- set literals
- matmul operator
- foo > bar > baz
- sorting callback semantics
- dunder methods for operator overriding
- list, dict and set comprehension
- generator expressions
- byte literals
- raise SystemExit() for clean script exit
- raw strings
- automatic string literal concatenation
- positional/keyword only parameters
- can use *args and **kwargs together, as opposed to spread
- docstrings
- typing is part of the language, no need for a transpiled dialect like typescript
- "async for" and "async with"
That's only what I come up on the fly, I'm pretty sure I can double the list. Then of course, do we consider builtin to be part of the stdlib, since it doesn't require any import? Because there is a load to say there.
JS does have some nice stuff too though:
- ? and ??
- futures are more ergonomic than coroutines and awaitable anyway
- more powerful destructuration
- regex literals
https://docs.python.org/3/library/weakref.html#weakref.final...
comprehension alone are a game changer - language wise
Debatable. But either way it's definitely a much worse language than Typescript so I agree.