On Oct 13, 2015 2:11 AM, "Steven D'Aprano" <st...@pearwood.info> wrote: > > On Tue, 13 Oct 2015 04:20 am, Marko Rauhamaa wrote: > > > As for managing complexity, many people believe static typing is a > > crucial tool. I disagree. Static typing adds vast amounts of noise to > > the code. > > Only if you are stuck in the 1970s. And even then, it is not always noise, > type declarations or annotations often make useful documentation. > > Consider the following piece of code: > > def addone(x): > return x + 1 > > > The human programmer reading that can trivially infer that x must be a > number (or at least something which supports numeric addition). So can the > compiler. In a strongly typed language with no numeric promotion, the > compiler can infer that x must be an int. In a language with numeric > promotion, it can infer that x must be an int or float.
Or a decimal, complex number, numpy array, any one of a dozen or so pandas classes, any one of the dozen or so units classes, sympy variable, etc...
-- https://mail.python.org/mailman/listinfo/python-list