Skip to content

Instantly share code, notes, and snippets.

@rajmayank
Last active June 10, 2021 01:48
Show Gist options
  • Save rajmayank/95211121a2a2f7475a268a4c5b8a4616 to your computer and use it in GitHub Desktop.
Save rajmayank/95211121a2a2f7475a268a4c5b8a4616 to your computer and use it in GitHub Desktop.
Python-Generators-Memory-Footprint
items1 = ["Item #1", "item #2",]
items2 = ["Item #1", "item #2","Item #4", "item #5",]
items3 = ["Item #1", "item #2","Item #4", "item #5", "item#6", "item#7",]
sys.getsizeof(items1) # 72 bytes
sys.getsizeof(items2) # 120 bytes
sys.getsizeof(items3) # 152 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment