In JS, you can do something similar, assign all key, values of an object / dict, obj
to be in the global namespace / context obj with this[key] = obj[key]
I expected to be able to do the same with
class A:
def call(self):
print('a')
a = A()
globals()['call'] = lambda: None
print(globals())
setattr(globals(), 'call', a.call)
the confusing thing is that the error I'm getting is AttributeError: 'dict' object has no attribute 'call'
even though call is clearly defined when I print globals()