CapPython's treatment of Python builtins
Blocked:
- type
- file
- open
- reload
- globals - looks up stack
- locals - looks up stack
- execfile
- eval
- input
- raw_input
Attribute access:
- getattr, hasattr, dir - wrapped
- setattr, delattr - blocked
Imports:
__import__ - wrapped/replaced
Object-related builtins, probably safe:
- object
- classmethod
- property
- staticmethod
- super - becomes magic in Python 3.0 (looks up stack)
- isinstance
- issubclass
Safe:
- abs
- all
- any
- apply
- basestring
- bool
- buffer
- callable
- chr
- cmp
- coerce
- complex
- dict
- divmod
- enumerate
- filter
- float
- frozenset
- hash
- hex
- id
- int
- intern (can consume non-garbage-collectable resources?)
- iter
- len
- list
- long
- map
- max
- min
- oct
- ord
- pow
- range
- reduce
- repr
- reversed
- round
- set
- slice
- sorted
- str
- sum
- tuple
- unichr
- unicode
- xrange
- zip
Some builtins expose nondeterminism:
- str, repr, id - expose object addresses
- min, max, cmp - expose ordering of object addresses
- hash - uses object addresses
However, this is not considered a problem because CapPython does not aim to be deterministic. Non-determinism is also exposed by built-in types (in particular, dicts), repr and str are available via the % operator on strings, and object address ordering is exposed by comparison operators.
