Another question

Jeff Massung jmassung at magpiesystems.com
Mon Apr 17 20:29:19 EDT 2000


Donald Beaudry wrote in message <200004172120.RAA11102 at zippy.init.com>...
>and this one is better still (at least on my machine):
>
>  def do_it():
>      from random import randint
>      r = [0,] * 100000
>      for i in xrange(100000):
>         r[i] = randint(1,10)
>  do_it()
>

With the "from/import" being local, does the namespace go away after the
function is done? How fast is importing (say I called do_it() 10000 times -
then how efficient is your function?)

Jeff





More information about the Python-list mailing list