I've been using the globals()[name]
method to look up Python variables by name. I can't use only an environment dict, because I need to be able to interface with existing scripts.
The problem is, it doesn't work with name = "op.eq"
, for example. Other than simply splitting on .
, looking up op
, then getting vars(globals()['op'])['eq']
, is there a way to look up op.eq
and other dot-notation references?