Last active
February 16, 2017 16:56
-
-
Save hhc0null/40a5c28b0040c6808c8d610a810303ca to your computer and use it in GitHub Desktop.
__lshift__
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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