News for hackers. Stuff that matters.

gbts

Re:Static types in Python on Thursday October 13, 2016 @09:20PM (#12705556)
Enforcing type hints would be impossible to implement without breaking a lot of existing Python code. If module A suddenly introduces them, module B that depends on it would have to suddenly make sure that all arguments it passes conform. If another module C depends on B and passes arguments that are in turn passed to module A, that basically means that the author of B is forced to add type hints to its code as well. In practice this would rapidly turn the whole language into a semi-statically typed one which (a) was never the intention and (b) would turn the whole ecosystem into a complete mess with incompatible typed and non-typed code unable to interact with each other.