Skip to content

Instantly share code, notes, and snippets.

@jmb0z
Last active October 23, 2016 14:12
Show Gist options
  • Save jmb0z/139e6166e061a564285ea69d6643b215 to your computer and use it in GitHub Desktop.
Save jmb0z/139e6166e061a564285ea69d6643b215 to your computer and use it in GitHub Desktop.
Python2.7 64bit
Bytes type empty + scaling notes
24 int NA
28 long NA
37 str + 1 byte per additional character
52 unicode + 4 bytes per additional character
56 tuple + 8 bytes per additional item
72 list + 32 for first, 8 for each additional
232 set sixth item increases to 744; 22nd, 2280; 86th, 8424
280 dict sixth item increases to 1048; 22nd, 3352; 86th, 12568
64 class inst has a __dict__ attr, same scaling as dict above
16 __slots__ class with slots has no dict, seems to store in
mutable tuple-like structure.
120 func def doesn't include default args and other attrs
904 class def has a proxy __dict__ structure for class attrs
104 old class makes sense, less stuff, has real dict though.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment