rexec: I don't seem to understand "nok_builtin_names"
Dan Moskowitz
danielm at cronus.res.cmu.edu
Thu Mar 28 14:51:23 EST 2002
More information about the Python-list mailing list
Thu Mar 28 14:51:23 EST 2002
- Previous message (by thread): rexec: I don't seem to understand "nok_builtin_names"
- Next message (by thread): findsyms.py - new script to help you document Python...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Can someone tell me why execing "open" works, but not "len"?
>>> from rexec import RExec
>>>
>>> class MyRExec(RExec):
... nok_builtin_names = RExec.nok_builtin_names + ("len",)
...
>>> r = MyRExec()
>>> print 'invisible names: '+`r.nok_builtin_names`
invisible names: ('open', 'reload', '__import__', 'len')
>>> r.r_exec('open')
>>> r.r_exec("len('foo')")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/depot/python2/lib/python2.1/rexec.py", line 264, in r_exec
exec code in m.__dict__
File "<string>", line 1, in ?
NameError: name 'len' is not defined
- Previous message (by thread): rexec: I don't seem to understand "nok_builtin_names"
- Next message (by thread): findsyms.py - new script to help you document Python...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list