I'm sure there's a better way, but in the mean time, here is a shamelessly cheesy method: def rShift( i, n ): leftbit = 0x80000000 if i & leftbit: return ((i& ~leftbit)>>n)|(0x40000000 >> n-1) return i >> n (this is won't work so well on platforms that have 64-bit ints, either)