I want to use a function from another module as a decorator, but I need it to manipulate the current global module namespace.
For example, I want to be able to switch from this:
class SomeClass:
pass
root = SomeClass
:
from othermodule import decorator
@decorator
class Someclass:
pass
Any ideas?
source
share