Closed
Description
We should add "no-new-attributes" behavior to all our models in pip._internal.models
. It'd be easy to enforce this constraint on them using the interpreter than manually in code reviews. :)
Two of the ways to achieve this using just the standard library are:
__slots__
collections.namedtuple
- (both together?)
In case someone (eg. a future me) wants to look up how slots work, take a look at https://stackoverflow.com/a/28059785/1931274.
Originally posted by @pradyunsg in #7310