In places where we use the variable object as a key, we should consider replacing it with the variable name. This will be helpful for serializing to file and reconstructing objects from file. However, there could be ramifications where places where we use is to test for objects, and we need to consider whether that will be less convenient. For example:
if x in gradient
vs.
if x.name in gradient
It might be possible to specially define the __getitem__ method to reinterpret variables to use their name, though, and retain the first behavior.
In places where we use the variable object as a key, we should consider replacing it with the variable name. This will be helpful for serializing to file and reconstructing objects from file. However, there could be ramifications where places where we use
is
to test for objects, and we need to consider whether that will be less convenient. For example:vs.
It might be possible to specially define the
__getitem__
method to reinterpret variables to use their name, though, and retain the first behavior.