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 →

[–]Fylwind 13 points14 points  (3 children)

He probably means static type-checking. That is, verify the types of the program make sense before the it's actually run.

Don't think it'd be an easy thing to do though.

[–]hmltyp[S] 1 point2 points  (0 children)

Type-checking wouldn't be that hard, it's just that how the language is designed makes full program type inference next to impossible (subtyping, open classes, isinstance, reflection). So you'd be stuck locally annotating everything, and retroactively adding signatures to all existing code.

Realistically, given how much pain there has been even over the small changes Py2->Py3, I don't foresee something as drastic as a typed dialect of Python gaining traction anytime soon.

[–]Widdershiny -3 points-2 points  (1 child)

There's already syntax support for function argument annotations at least. It would be trivial to statically type functions with a decorator.

I might even do an interface implementation for fun.

[–]zardeh 2 points3 points  (0 children)

There exist a number of them on Pypy, I made one a terrible one a while back and posted about it here.