"builtins" --- Built-in objects
*******************************

======================================================================

This module provides direct access to all 'built-in' identifiers of
Python; for example, "builtins.open" is the full name for the built-in
function "open()".  See 組み込み関数 and 組み込み定数 for
documentation.

通常このモジュールはほとんどのアプリケーションで明示的にアクセスされる
ことはありませんが、組み込みの値と同じ名前のオブジェクトを提供するモジ
ュールが同時にその名前の組み込みオブジェクトも必要とするような場合には
有用です。たとえば、組み込みの "open()" をラップした "open()" という関
数を実装したいモジュールがあったとすると、このモジュールは次のように直
接的に使われます:

   import builtins

   def open(path):
       f = builtins.open(path, 'r')
       return UpperCaser(f)

   class UpperCaser:
       '''Wrapper around a file that converts output to uppercase.'''

       def __init__(self, f):
           self._f = f

       def read(self, count=-1):
           return self._f.read(count).upper()

       # ...

ほとんどのモジュールではグローバル変数の一部として "__builtins__" が利
用できるようになっています。 "__builtins__" の内容は通常このモジュール
そのものか、あるいはこのモジュールの "__dict__" 属性です。これは実装の
詳細部分なので、異なる Python の実装では "__builtins__" は使われていな
いこともあります。
