[Types-sig] Type Inference I

Paul Prescod paul@prescod.net
Sat, 18 Dec 1999 13:59:28 -0600


I don't see how this strategy can work.

skaller wrote:
> 
> You might just think, seeing
> 
>         x + 1
> 
> that if x is not an integer, the code must be an error,
> but the example above shows that you'd be wrong
> if you said that.

But as you and others have pointed out, Python is protocol-centric, not
type-centric. In real Python, x could be anything that with an __add__
function. The optimization opportunity is thus dubious. 

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Three things never trust in: That's the vendor's final bill
The promises your boss makes, and the customer's good will 
http://www.geezjan.org/humor/computers/threes.html