Skip to content

Instantly share code, notes, and snippets.

@brunokim
Created June 9, 2022 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunokim/a894076bf727ba18d29b3279a867fd10 to your computer and use it in GitHub Desktop.
Save brunokim/a894076bf727ba18d29b3279a867fd10 to your computer and use it in GitHub Desktop.
def get_counter_size(c: Counter) -> int:
size = sys.getsizeof(c)
size += sum(sys.getsizeof(key) for key in c)
return size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment