Andy Cheesman wrote: > Hi people, > > After watching a nice Google video on Python 3K, and seeing the > forthcoming removal of range, I've looked at substitution range with > xrange within my code. Direct substitution works for 90% percent of the > case (i.e. for thing in xrange(number): ), however i can't change the > example below where I need a non-continuous range. Any suggestions? > > Andy > > x = range(10) + range(20, 30) > > for thing in x: > ...
Define your own top-level range as: def range (x): return list (xrange (x)) maybe? TJG _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor