sys.getsizeof() on a code object returns the size of the code struct, not all the other objects it references.
To measure real usage, you have to use another method. I use ipython_memory_usage because it's easy to use.
You can test this out easily by making a large dict and see how much your OS thinks python is using vs what sys.getsizeof is reporting.
It should not be controversial that namedtuples are clearer for the reason I stated in my initial comment.