"builtins" --- 內建物件
***********************

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

該模組提供對 Python 所有'內建'識別符號的直接存取；例如 "builtins.open"
是內建函式 "open()" 的全名。請參閱內建函式和內建常數的文件。

大多數應用程式通常不會顯式地存取此模組，但在提供與內建值同名之物件的模
組中可能很有用，不過其中還會需要內建該名稱。例如，在一個將內建
"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 upper-case.'''

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

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

       # ...

有個實作細節是，大多數模組都將名稱 "__builtins__" 作為其全域性變數的一
部分以提使用。"__builtins__" 的值通常是這個模組或者這個模組的
"__dict__" 屬性值。由於這是一個實作細節，因此 Python 的其他實作可能不
會使用它。
