[Python-ideas] PEP 484 (Type Hints) -- second draft

Cameron Simpson cs at zip.com.au
Tue Mar 24 00:50:53 CET 2015


On 23Mar2015 15:19, Chris Barker - NOAA Federal <chris.barker at noaa.gov> wrote:
>On Mon, Mar 23, 2015 at 2:41 PM, Cameron Simpson <cs at zip.com.au> wrote:
>> But it scales very badly; what of a 4 way if etc? It moves from a bit less
>> readable to a nightmare.
>
>in python one particular type or None is a very common idiom -- well worth
>special casing. Somethign that could take or return 4 different types is a
>far less usual case, we can be more verbose there.

I did not mean 4 different types, I meant a four (or more) way decision which 
gave a (probably) single type or None. If "a if b else c" construction rapidly 
becomes ery hard to read/verify.

Cheers,
Cameron Simpson <cs at zip.com.au>

A crash reduces
your expensive computer
to a simple stone.
- Haiku Error Messages http://www.salonmagazine.com/21st/chal/1998/02/10chal2.html


More information about the Python-ideas mailing list