summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fbuiltins.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/python~3.12/library%2Fbuiltins.html')
-rw-r--r--devdocs/python~3.12/library%2Fbuiltins.html22
1 files changed, 0 insertions, 22 deletions
diff --git a/devdocs/python~3.12/library%2Fbuiltins.html b/devdocs/python~3.12/library%2Fbuiltins.html
deleted file mode 100644
index 779799b3..00000000
--- a/devdocs/python~3.12/library%2Fbuiltins.html
+++ /dev/null
@@ -1,22 +0,0 @@
- <span id="builtins-built-in-objects"></span><h1>builtins — Built-in objects</h1> <p>This module provides direct access to all ‘built-in’ identifiers of Python; for example, <code>builtins.open</code> is the full name for the built-in function <a class="reference internal" href="functions#open" title="open"><code>open()</code></a>. See <a class="reference internal" href="functions#built-in-funcs"><span class="std std-ref">Built-in Functions</span></a> and <a class="reference internal" href="constants#built-in-consts"><span class="std std-ref">Built-in Constants</span></a> for documentation.</p> <p>This module is not normally accessed explicitly by most applications, but can be useful in modules that provide objects with the same name as a built-in value, but in which the built-in of that name is also needed. For example, in a module that wants to implement an <a class="reference internal" href="functions#open" title="open"><code>open()</code></a> function that wraps the built-in <a class="reference internal" href="functions#open" title="open"><code>open()</code></a>, this module can be used directly:</p> <pre data-language="python">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()
-
- # ...
-</pre> <p>As an implementation detail, most modules have the name <code>__builtins__</code> made available as part of their globals. The value of <code>__builtins__</code> is normally either this module or the value of this module’s <a class="reference internal" href="stdtypes#object.__dict__" title="object.__dict__"><code>__dict__</code></a> attribute. Since this is an implementation detail, it may not be used by alternate implementations of Python.</p> <div class="_attribution">
- <p class="_attribution-p">
- &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
- <a href="https://docs.python.org/3.12/library/builtins.html" class="_attribution-link">https://docs.python.org/3.12/library/builtins.html</a>
- </p>
-</div>