[Python-Dev] Type hints -- a mediocre programmer's reaction

Terry Reedy tjreedy at udel.edu
Thu Apr 23 09:29:04 CEST 2015


On 4/22/2015 8:45 PM, Guido van Rossum wrote:
> On Wed, Apr 22, 2015 at 2:38 PM, Chris Barker <chris.barker at noaa.gov
> <mailto:chris.barker at noaa.gov>> wrote:

>     On Tue, Apr 21, 2015 at 11:32 PM, Terry Reedy <tjreedy at udel.edu
>     <mailto:tjreedy at udel.edu>> wrote:
>
>         I was just thinking today that for this, typing needs a
>         subtraction (difference) operation in addition to an addition
>         (union) operation: Difference(Iterable(str), str)

>     Anyway, the point is that being able to say "all these types, except
>     this one" would solve this particular problem -- but would it solve
>     any others? Do we want this to work around a quirk in Pythons string
>     type?

> More seriously, I doubt there are other important use cases for Difference.

I thought about Difference(numbers.Number, complex) to get ordered 
numbers, but numbers.Real should probably work.  I agree more real uses 
are needed before adding Difference.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list