Python is DOOMED! Again!

Steven D'Aprano steve+comp.lang.python at
Thu Jan 22 05:30:57 CET 2015

Occasionally you find people spreading Fear, Uncertainty, Doubt about 
Python. Python is now over 20 years old and one of the most popular 
languages in the world no matter how you measure popularity:

so you don't often get FUD these days. When you do, it's usually about 
whitespace, or "Python is too slow", or occasionally "Python 3 is killing 
Python", but the latest FUD is about PEP 484 and type-hinting:

Here's a typical example:

    Python is already headed towards obscurity. ... it seems that 
    GvR intends to drive the final nail in python's coffin with 
    this "type hinting" crap that will convert Python syntax from 
    a readable pseudo code into a cryptic nightmare.

    Type hinting violates the very ESSENCE of what Python was
    meant to be, that is: a "clean and intuitive syntax". 

(Google for it if you care for the source.)

So what is this unspeakable, nightmarish, cryptic abomination going to look 
like? Here's an example from PEP 484:

def greeting(name: str) -> str:
    return 'Hello ' + name

I don't know about you, but I think anyone who cannot read that and intuit 
that argument `name` is a string and the return result is also a string is 
probably going to have bigger troubles with Python than just type-hinting.

Remember too that type-hinting will *absolutely* remain *completely* 
optional for Python. Developers can choose to use it or not, they can mix 
hinted code with regular unhinted code, they can use type declarations 
purely as documentation or they can run an optional type-checker, as they 

Here's a potential real-world example, from the statistics module in Python 
3.4, before and after adding annotations:

def median_grouped(data, interval=1): ...

def median_grouped(data:Iterable[Real], interval:Real=1)->Real: ...

I say "potential" because the standard library doesn't use annotations yet, 
but it may in the future. 

So how does Python's proposed type-hints compared to that used by other 


  public double median_grouped(List<Double> data, double interval) {}


  function median_grouped(data: IterableOfReal; interval: Real): Real;


  median_grouped (IterableOfReal data, double interval)


  median_grouped               :: [Double] Double -> Double
  median_grouped data interval =  ...

(I may have taken some very slight liberties with the syntax, corrections or 
more idiomatic forms are very welcome.)

I think it is clear that Python's annotation syntax remains quite close to 
executable pseudo-code. Fears that type-hints will doom Python are not 


More information about the Python-list mailing list