There is a quite a lot of redundancy in code, function and generator objects. ### Intra-object redundancy 1. Code objects have four fields ,`co_nlocalsplus`, `co_nplaincellvars`, `co_nlocals`, `co_nfreevars`. Any of these fields can be computed from the other three. 2. Code objects have a qualified name and a name. The name is always the suffix of the qualified name. Changing this to qualifying prefix and name would save space and allow sharing. 3. The defaults and keyword defaults for a function are separate and the keyword defaults are a dict. They could be combined into a single array. 4. Generator objects have a `gi_code` field, which is redundant, as the frame contains a reference to the code object. ### Inter-object redundancy 1. Functions and generators have qualified name and name fields, which are almost always the same as the underlying code object. These should be lazily initialized <!-- gh-linked-prs --> ### Linked PRs * gh-100721 * gh-100749 <!-- /gh-linked-prs -->