On Apr 21, 2006, at 8:36 AM, Greg Ewing wrote:

> Guido van Rossum wrote:
>> If I have some utterly dynamic
>> code that comes up with a list of a million ints, and then I pass  
>> that
>> as an argument to a function that requests the argument type is
>> list[int],
>
> you wrap it in something that checks elements for intness
> as you access them. [...]

I think it's important for code to fail early if type constraints  
aren't satisifed.

The approach you suggest (wrapping the object) would cause a function  
with a badly typed argument to blow up part-way through executing,  
possibly at a position far-distant from the place where the type  
constraint was violated, and possibly after various side-effects have  
already taken place.

-Edward

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to