What does the >>
operator do? For example, what does the following operation 10 >> 1 = 5
do?
You can actually overloads right-shift operation(>>) yourself.
>>> class wierd(str):
... def __rshift__(self,other):
... print self, 'followed by', other
...
>>> foo = wierd('foo')
>>> bar = wierd('bar')
>>> foo>>bar
foo followed by bar
Reference: http://www.gossamer-threads.com/lists/python/python/122384