gpython icon indicating copy to clipboard operation
gpython copied to clipboard

builtins id dir function not found

Open QGB opened this issue 1 year ago • 2 comments


>>> import builtins
>>> builtins.id
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: "'module' has no attribute 'id'"
>>> 
>>> builtins.dir
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: "'module' has no attribute 'dir'"

vars

QGB avatar Apr 19 '24 05:04 QGB

sys.modules also not support

QGB avatar Apr 19 '24 05:04 QGB


>>> exec('print(locals())',{1:2},{})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    FIXME line of source goes here
KeyError: 'FIXME can only have string keys!: 1'

>>> exec('print(locals())',{'1':2},{'3':3})
{'3': 3}

>>> eval('print(locals())',{'1':2},{'3':3})
{'3': 3}

QGB avatar Apr 19 '24 05:04 QGB