News for hackers. Stuff that matters.
Re:PEP 526: Variable declaration in Python by toyg on Thursday August 11, 2016 @06:25AM (#12267146)
because they will lose readability and raise the bar for contribution from novices. Every extra feature you add to the language requires extra effort to read and extra effort from novices to understand.
Re:PEP 526: Variable declaration in Python by singhblom on Thursday August 11, 2016 @06:43AM (#12267199)
I don't know about this. My feeling from working with Typescript and Javascript is that the type hints really help people understand what is happening. My background is as a Python programmer, but Typescript really convinced me that optional type hints are a super-valuable addition to a dynamic language. Most of my docstrings in python tend to be type annotations anyway -- might as well make it possible for tools to support it easily.
Re:PEP 526: Variable declaration in Python by yedpodtrzitko on Thursday August 11, 2016 @06:40AM (#12267191)
"Readability" depends on a context. I've worked with a huge codebases where having a variable types attached to the variables there would actually improve the readability. Sure, it would take you a moment longer to skim the line, but overall it would save you a much more time to figure out what's the variable about.
Re:PEP 526: Variable declaration in Python by 2T1Qka0rEiPr on Thursday August 11, 2016 @06:43AM (#12267200)
@dozzie, I don't think static typing does make it easier to read, it makes it more verbose.
Re:PEP 526: Variable declaration in Python by catnaroek on Thursday August 11, 2016 @07:34AM (#12267360)
Are you confusing “static typing” with “type annotations”? You can write large swathes of statically typed code without a single type annotation, in languages with proper type inference. This is 70's-era technology, mind you.
Re:PEP 526: Variable declaration in Python by 2T1Qka0rEiPr on Thursday August 11, 2016 @10:45AM (#12268609)
You're right, I'm conflating the two, though I appreciate that one doesn't require the other.
Re:PEP 526: Variable declaration in Python by dozzie on Thursday August 11, 2016 @06:39AM (#12267187)
>>> [...] before you know it all "serious codebases" will be statically typed.

> because they will lose readability and raise the bar for contribution from novices

OK, hold for a second. Adding something to make the code easier to follow will make code harder to follow? Is this really your argument?

And why would a novice to a language want to contribute to "serious codebase"? I don't think Django, Jinja, or NumPy are popular for Python novices to contribute code.