I think that limitation of statically typed Python alone is enough to give this new language a chance.
It's also looks like the type inference of erg will be better than the current Python checkers.
I think that limitation of statically typed Python alone is enough to give this new language a chance.
It's also looks like the type inference of erg will be better than the current Python checkers.
I think it's pretty damn amazing how well Python has been able to evolve into the realm of static typing. And no unofficial superset syntax required!
Pylance (the VSCode built-in linter, based on Pyright I believe) tends to do a better job than Mypy, but not as easy to integrate into CI. It's a real shame that the Python ecosystem doesn't have anything nearly as robust as TypeScript.
[0] https://github.com/python/mypy/issues?q=is%3Aopen+is%3Aissue...
Anyway I tried it on a mypy clean codebase and it gave a gazillion false positives so I never bothered to integrate it more properly.
Last I used it, it was miles ahead of mypy in terms of speed, easy-of-use (it's an LSP!), correctness (simply has less bugs), and feature completeness (has implemented every new static typing feature that I've wanted to use months ahead of mypy).
The maintainer was also super-responsive on Github: replied to my issues in hours/minutes, and often released minor versions with bugfixes one or two days after issues are reported.
Plus, at least half a dozen highly funded people have tried to recreate TypeScript and have failed. Microsoft is flawed, but they can make a mean type checker.
https://peps.python.org/pep-0646/#grammar-changes
The other case that I remember off the top of my head is Python 3.6 adding annotations for variables that aren't created via function definitions:
Also thanks about pointing out the syntax change for variadic generics! I still think my overall point about pace of "syntactic innovation" in static typing remaining slow stands, though. Just comparing equivalent typescript and python constructs:
This in TS:
{ member?: string, other_member: string }
is currently in python: from typing import TypedDict
class SmallerObj(TypedDict, total=False):
member: str
class Obj(SmallerObj):
other_member: str
Python 3.11 will shorten the above to: from typing import TypedDict, NotRequired
class Obj(TypedDict):
member: NotRequired[str]
other_member: str
But still ...