Macaulay2 » Documentation
Packages » Python » PythonObject » PythonObject >> PythonObject
next | previous | forward | backward | up | index | toc

# PythonObject >> PythonObject -- the right shift operator for Python objects

- Operator: >>
- Usage:
    `x >> y`
- Inputs:
  - x, a python object,
  - y, a python object,
- Outputs:
  - a python object, the result of shifting x right by y;

## Description

Perform the right shift operator on Python objects.

    i1 : toPython 128 >> toPython 3

    o1 = 16

    o1 : PythonObject of class int

If one of the arguments is a Macaulay2 object, then it is first converted to a Python object before shifting.

    i2 : toPython 256 >> 5

    o2 = 8

    o2 : PythonObject of class int

    i3 : 16384 >> toPython 4

    o3 = 1024

    o3 : PythonObject of class int

## See also

- PythonObject << PythonObject -- the left shift operator for Python objects
- PythonObject >>= Thing -- augmented right shift for Python objects

### Menu

- PythonObject >>= Thing -- augmented right shift for Python objects

## Ways to use this method:

- PythonObject >> PythonObject -- the right shift operator for Python objects
- `PythonObject >> Thing`
- `Thing >> PythonObject`

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Python/doc/bitwise.m2:132:0.