mailWhy is a range in relax created as xrange objects which is not sliceable?


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels Emtekær Linnet on December 10, 2013 - 12:48:
Hi Edward.

I wonder why range objects in relax by default are created as
xrange objects?

I think this is related to the error when importing matplotlib.
from pylab import *

-------
relax> M31=range(10)
relax> type(M31)
<type 'xrange'>
relax> print M31[:7]
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: sequence index must be integer, not 'slice'
-----

Best
Troels

Related Messages


Powered by MHonArc, Updated Tue Dec 10 15:20:08 2013