Are the critiques in "All the things I hate about Python" valid?

bartc bc at freeuk.com
Sun Feb 18 21:14:26 EST 2018


On 19/02/2018 00:09, Steven D'Aprano wrote:

> Sure, but only the most boring, uninteresting kinds of types can be so
> named. The point is that "sufficiently fine-grained types" can be
> arbitrarily complex.

I don't think so.

  If a human finds it hard to give it a meaningful
> name, no algorithm will do it either. Consider:
> 
> "positive odd integers greater than 10 but less than 15003 divisible by
> 17 except for 850, 867 and 1394; or primes that aren't Mersenne primes".

Is that a type? Or a function? Or a set? Or a constraint?

How would even a type for the odd numbers from 1 to 10 inclusive work? 
(That, a type consisting of one of the values in {1,3,5,7,9}.) Would 
they be ordered or unordered? Can I do arithmetic with them: will 3*3 
work, but not 3*5?

This is where keeping things simple pays off.

-- 
bartc



More information about the Python-list mailing list