If in my script I type the following, I get the correct output.
test = 'int' print(getattr(__builtins__, test)) #
However if I create another script named
builtin.py which contains the same and try to import it, the function does not work.
import builtin as b
AttributeError: 'dict' object has no attribute 'int'