Advertisement
Roman_Sarnov

Untitled

Jan 8th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. class ListCont():
  2. def __repr__(self):
  3. return f'Instance of {self.__class__.__name__} , address {id(self)}, {self.__attrname()}'
  4. def __attrname(self):
  5. result = ''
  6. for attr in dir(self):
  7. if attr[:2] == '__' and attr[-2:] == '__':
  8. result += f'\tname {attr} = <>\n'
  9. else:
  10. result += f'{attr} = {getattr(self,attr)}\n'
  11. return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement