[Python-3000] Type Comparisons with Godel Numbers
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Apr 21 14:36:34 CEST 2006
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. It'll still check a million ints if
you access them all, but that would have to be done anyway
if you were passing the list to fully dynamic code. And
it spreads the cost of doing it out over whatever is
being done with the ints, rather than doing it all up
front. And it doesn't bother checking any ints that you
don't use.
--
Greg
More information about the Python-3000
mailing list