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
""" | |
These two repr implementations make a "repr" that you can just drop into your class if it's a simple one. | |
""" | |
class A: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def __repr__(self): | |
return "%s(**%r)" % (self.__class__.__name__, self.__dict__) |