On 4/21/06, Greg Ewing <[EMAIL PROTECTED]> 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. 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.

That's the conclusion we reached last time too. Unfortunately the
wrapper slows down each access. I guess we could disable all checking
when -O is used...

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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