When Psyco starts, it replaces a few functions from the __builtin__ and sys modules with a version of its own. This trick fails if you made a copy of one of these functions elsewhere before Psyco has a chance to replace it, because the old copy will not behave properly in the presence of Psyco.
Built-in function | Notes |
---|---|
(1) | |
(1) when called with no argument | |
(1) when called with no argument | |
(2) when called with a single argument | |
(2) when called with a single argument | |
(2) | |
(3) |
Notes:
Note that it is common to find Python programs that use dynamic code evaluation for an effect that can be obtained by calling an ad-hoc built-in function instead. For example, eval('self.'+attr)
is better written as getattr(self, attr)
and exec 'import '+module
is better written as __import__(module, globals(), locals(), [])
.
Additionally, the exec
statement is not supported yet, as seen in section A.3.