LHB <loquehumaine@g mail.comwrites:
Marc 'BlackJack' Rintsch a écrit :
Ok. Should I only see `__builtins__` as an access to builtin
functions/exception/... ?
`__builtins__` is an implementation detail, and `__builtin__` is a name
of a module you can import. You should not use `__builtins__` but import
`__builtin__` and inspect that instead of `__builtins__`.
of a module you can import. You should not use `__builtins__` but import
`__builtin__` and inspect that instead of `__builtins__`.
functions/exception/... ?
access them that way. Ignore '__builtins__' altogether as an
implementation detail. (This is difficult to adhere to because the
names are confusingly similar; this is an acknowledged wart in current
Python.)
IIRC this behaviour will change in Python 3.0, where 'import
__builtin__' will be the *only* way to get at builtins from normal
code. At least, I'm now writing my code as though that's the case :-)
--
\ “The man who is denied the opportunity of taking decisions of |
`\ importance begins to regard as important the decisions he is |
_o__) allowed to take.†—C. Northcote Parkinson |
Ben Finney
Leave a comment: