Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 internal PythonRangeIterator(PythonRange range)
 {
     _range = range;
     _value = range.start - range.step; // this could cause overflow, fine
 }
Ejemplo n.º 3
0
 public bool __ne__([NotNull] PythonRange other) => !__eq__(other);
Ejemplo n.º 4
0
 public bool __ge__(PythonRange other)
 {
     throw new TypeErrorException("unorderable types: range() >= range()");
 }
Ejemplo n.º 5
0
 public bool __ne__(PythonRange other)
 {
     return(!__eq__(other));
 }