This file contains 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
import sys | |
def get_size(obj): | |
"""Recursively finds size of objects""" | |
size = 0 | |
if isinstance(obj, dict): | |
size += sum([get_size(v) for v in obj.values()]) | |
size += sum([get_size(k) for k in obj.keys()]) | |
elif hasattr(obj, '__dict__'): | |
size += get_size(obj.__dict__) |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am mylifeisshan on github. | |
* I am shan (https://keybase.io/shan) on keybase. | |
* I have a public key whose fingerprint is 5280 BDE7 3B21 2E9E 860E 31BE 948F 3F9A F93F E146 | |
To claim this, I am signing this object: |