Another question

Jeff Massung jmassung at
Tue Apr 18 02:29:19 CEST 2000

Donald Beaudry wrote in message <200004172120.RAA11102 at>...
>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?)


More information about the Python-list mailing list