#NEWLINE# def __new__( cls , start = None , stop = None , step = None , name = None , dtype = None , fastpath = False , copy = False , **kwargs ) : #NEWLINE# #INDENT# if fastpath : #NEWLINE# #INDENT# return cls . _simple_new ( start , stop , step , name = name ) #NEWLINE# #UNINDENT# cls . _validate_dtype ( dtype ) #NEWLINE# if isinstance ( start , RangeIndex ) : #NEWLINE# #INDENT# if ( name is None ) : #NEWLINE# #INDENT# name = start . name #NEWLINE# #UNINDENT# return cls . _simple_new ( name = step , ** dict ( start . _get_data_as_items ( ) ) ) #NEWLINE# #UNINDENT# def _ensure_int( value , field ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# new_value = int ( value ) #NEWLINE# assert ( new_value == value ) #NEWLINE# #UNINDENT# except ( ValueError , AssertionError ) : #NEWLINE# #INDENT# raise TypeError ( 'RangeIndex(...) must be called with integers, {value} was passed for {field}' . format ( value = type ( value ) . __name__ , field = field ) ) #NEWLINE# #UNINDENT# return new_value #NEWLINE# #UNINDENT# if ( start is None ) : #NEWLINE# #INDENT# start = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# start = _ensure_int ( start , 'start' ) #NEWLINE# #UNINDENT# if ( stop is None ) : #NEWLINE# #INDENT# stop = start #NEWLINE# start = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stop = _ensure_int ( stop , 'stop' ) #NEWLINE# #UNINDENT# if ( step is None ) : #NEWLINE# #INDENT# step = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( step == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Step must not be zero' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# step = _ensure_int ( step , 'step' ) #NEWLINE# #UNINDENT# #UNINDENT# return cls . _simple_new ( start , stop , step , name )