News for hackers. Stuff that matters.
Re:The state of type hints in Python by TTPrograms on Wednesday June 20, 2018 @10:59PM (#17361746)
The lesson is rather that optional static typing is useful. The programmer should be able to choose based on what makes sense for the task. Strictly statically typed languages preclude the option of going dynamic.
Re:The state of type hints in Python by logicchains on Wednesday June 20, 2018 @11:50PM (#17362001)
>Strictly statically typed languages preclude the option of going dynamic.

No they don't; even in C it's possible to just type everything as void*, and everything as Object in Java. Just nobody does this 'cos it introduces a bunch of unnecessary runtime errors.

Re:The state of type hints in Python by yorwba on Thursday June 21, 2018 @12:56AM (#17362263)
To call a method on a void* or a Java Object you first have to explicitly cast it to a type that has that method, which means that you need to declare a common interface and have each object explicitly implement that interface. Duck typing in dynamic languages doesn't require that level of ceremony.
Re:The state of type hints in Python by emidln on Thursday June 21, 2018 @03:20AM (#17362857)
This is the lesson I've learned in Clojure. We have varying levels of data shape specification, contracts, and static type checking available a-la-carte when you want it but not getting in your way when you don't.