[Tutor] Why does counting to 20 million stress my computer? (original) (raw)
Alan Gauld alan.gauld at blueyonder.co.uk
Wed Jul 21 23:38:32 CEST 2004
- Previous message: [Tutor] Why does counting to 20 million stress my computer?
- Next message: [Tutor] Why does counting to 20 million stress my computer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yes, I went with xrange(). But you've got me curious. I looked up generators in Learning Python, 2nd ed. Not sure I understand them, but would you expect using a generator to be a faster way to count than using xrange()? Could you give me an example that would fit my spin3.py below?
Not necessarily faster but it would lock up the PC as you originally saw. I think I read that generators are replacing xrange (or maybe xrange is just reimplemented using generators?)
Alan G
- Previous message: [Tutor] Why does counting to 20 million stress my computer?
- Next message: [Tutor] Why does counting to 20 million stress my computer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]