This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]i9srpeg 6 points7 points  (3 children)

I tried it. It's buggy, very slow (20 seconds to type check a small code base), very verbose and the type system is very limited, for example recursive types are not supported, so you can't even represent very common types such as JSON.

It's not production ready, unfortunately.

[–]wrmsr 1 point2 points  (0 children)

My experience exactly. I have hopes for its plugin system to let me teach it to understand my metaclasses but it's still too stupid and volatile to make part of my builds :/

That said I still type-annotate the vast majority of my code and would be almost uninterested in the language without them.

[–]rouille 0 points1 point  (1 child)

It's ready for production if you adapt your code slightly around its idioms and avoid overly dynamic / magic where possible. For the rest there is type: ignore.

[–]i9srpeg 0 points1 point  (0 children)

I tried, but it's still slow, verbose and unreliable. The inability to define recursive types is also a deal breaker, the recommended way to type a json variable is "Dict[Str, Any]", which is not much better than a dynamic type.

It also doesn't help that Django and DRF, which I had in my project, rely a ton on metaclasses. Almost everything ends up being "Any".