l = range(int(1E9))

Ben Finney ben+python at benfinney.id.au
Thu Apr 30 13:41:29 EDT 2015


Cecil Westerhof <Cecil at decebal.nl> writes:

> That works, yes. Now I get a MemoryError and the other processes are
> left alone. Now determining what are the best values.

I would strongly recommend that “best values” includes “run Python
version >= 3”.

One of the many problems you avoid by leaving Python 2 behind is that
many functions which used to return entire collections, now return lazy
evaluators (such as generators or views) which will not consume memory
the way you're describing.

Please try to learn Python using only the currently-developed Python 3.

-- 
 \     “Listen: we are here on Earth to fart around. Don't let anybody |
  `\                  tell you otherwise.” —_Timequake_, Kurt Vonnegut |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list