Beispiel #1
0
 public bool __eq__([NotNull] PythonRange other)
 {
     if (_length != other._length)
     {
         return(false);
     }
     if (_length == 0)
     {
         return(true);
     }
     if (start != other.start)
     {
         return(false);
     }
     if (_length == 1)
     {
         return(true);
     }
     if (Last() != other.Last())
     {
         return(false);
     }
     return(step == other.step);
 }
Beispiel #2
0
 internal PythonRangeIterator(PythonRange range)
 {
     _range = range;
     _value = range.start - range.step; // this could cause overflow, fine
 }
Beispiel #3
0
 public bool __ne__([NotNull] PythonRange other) => !__eq__(other);
Beispiel #4
0
 public bool __ge__(PythonRange other)
 {
     throw new TypeErrorException("unorderable types: range() >= range()");
 }
Beispiel #5
0
 public bool __ne__(PythonRange other)
 {
     return(!__eq__(other));
 }