Skip to content

Instantly share code, notes, and snippets.

@hhc0null
Last active February 16, 2017 16:56
Show Gist options
  • Save hhc0null/40a5c28b0040c6808c8d610a810303ca to your computer and use it in GitHub Desktop.
Save hhc0null/40a5c28b0040c6808c8d610a810303ca to your computer and use it in GitHub Desktop.
__lshift__
class Cell:
def __init__(self, *args):
self.stock = [*args]
def __lshift__(self, value):
self.stock.append(value)
return self
if __name__ == '__main__':
c = Cell('a', 'b', 'c')
print(c.stock)
c << 0 << 1 << 2
print(c.stock)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment