Using Python 2

Rick Johnson rantingrickjohnson at gmail.com
Sun Sep 10 12:06:39 EDT 2017


Ian wrote:
> Rick Johnson wrote:
> > Ned Batchelder wrote:
> > > Leam Hall wrote:
> > > > 
> > > > I've read comments about Python 3 moving from the Zen of
> > > > Python. I'm a "plain and simple" person myself.
> > > > Complexity to support what CompSci folks want, which was
> > > > used to describe some of the Python 3 changes, doesn't
> > > > help me get work done.
> > >
> > > I've heard a lot of FUD about the Python 3 transition,
> > > but this one is new to me.  What is it that CompSci folks
> > > want that developers don't want, that ruined Python 3?
> >
> > TWO WORDS: "Type" and "Hints"
> 
> Fail.
> 
> 1. Type hints were only added in 3.5, not Python 3.0, so
> this does not support the claim that Python 3 changes were
> made to support CS.

But it is true that CS purist want type annotations while 99%
of the everyday Python programmers can live happily without
them. "Practicality beats purity". 

> 2. Type hints are completely optional, so this does not
> support the claim that Python 3 added complexity that is
> counter-productive to "simple" users. If you want to keep
> your program simple, you can: just don't use them.

True, individual programmers can choose to omit type-hints
from their own code, but they cannot choose to omit type-
hints from the code they are forced to read. Once type
annotations start propagating in the wild, the syntactical
noise of statically typed languages will be ever-present in
Python code, only problem is, we will get *NONE* of the
advantages of _real_ statically typed languages, namely:
executables, compiler optimizations, and enhanced execution
speed. Heck, all we get in return for our painful eyeball
parsings are (maybe) better linters. Which is not an ROI
worthy of my sweat equity.

> 3. Type hints are practical. You may not need or desire
> them for pet projects, but large-scale projects with a
> large team of developers require a large degree of testing.
> Static typing supports this. This is a feature for
> enterprise users, not theorists.

I was never against Python having a type annotation feature,
no, i am only against the inclusion of this syntacticly noisy
feature in the .py[w] files. Mandating that type annotations
be defined in _external_ stub files places the onerous on
those who care about type annotations (a micro minority of
CS purist), and removes it from those who don't (the
remaining majority of Python programmers). 

I'm telling you, we can still prevent this feature from
destroying the language, *IF* we act quickly.




More information about the Python-list mailing list