Class PyXRange

  • All Implemented Interfaces:
    java.io.Serializable

    public class PyXRange
    extends PySequence
    Used to implement the builtin xrange function. Significant patches contributed by Jason Orendorff - jorendor@cbu.edu
    Since:
    JPython 0.3
    Author:
    Jim Hugunin - hugunin@python.org
    See Also:
    Serialized Form
    • Field Detail

      • start

        public int start
      • stop

        public int stop
      • step

        public int step
    • Constructor Detail

      • PyXRange

        public PyXRange​(int start,
                        int stop,
                        int step)
    • Method Detail

      • __len__

        public int __len__()
        Description copied from class: PyObject
        Equivalent to the standard Python __len__ method. Part of the mapping discipline.
        Overrides:
        __len__ in class PyObject
        Returns:
        the length of the object
      • __add__

        public PyObject __add__​(PyObject generic_other)
        Description copied from class: PyObject
        Equivalent to the standard Python __add__ method
        Overrides:
        __add__ in class PyObject
        Parameters:
        generic_other - the object to perform this binary operation with (the right-hand operand).
        Returns:
        the result of the add, or null if this operation is not defined
      • __findattr__

        public PyObject __findattr__​(java.lang.String name)
        Description copied from class: PyObject
        A variant of the __findattr__ method which accepts a Java String as the name. Warning: name must be an interned string!
        Overrides:
        __findattr__ in class PyObject
        Parameters:
        name - the name to lookup in this namespace must be an interned string .
        Returns:
        the value corresponding to name or null if name is not found
        See Also:
        PyObject.__findattr__(PyString)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class PyObject
      • tolist

        public PyList tolist()