summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fmmap.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/python~3.12/library%2Fmmap.html')
-rw-r--r--devdocs/python~3.12/library%2Fmmap.html136
1 files changed, 136 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Fmmap.html b/devdocs/python~3.12/library%2Fmmap.html
new file mode 100644
index 00000000..b5842ddd
--- /dev/null
+++ b/devdocs/python~3.12/library%2Fmmap.html
@@ -0,0 +1,136 @@
+ <span id="mmap-memory-mapped-file-support"></span><h1>mmap — Memory-mapped file support</h1> <div class="availability docutils container"> <p><a class="reference internal" href="https://docs.python.org/3.12/library/intro.html#availability"><span class="std std-ref">Availability</span></a>: not Emscripten, not WASI.</p> <p>This module does not work or is not available on WebAssembly platforms <code>wasm32-emscripten</code> and <code>wasm32-wasi</code>. See <a class="reference internal" href="https://docs.python.org/3.12/library/intro.html#wasm-availability"><span class="std std-ref">WebAssembly platforms</span></a> for more information.</p> </div> <p>Memory-mapped file objects behave like both <a class="reference internal" href="stdtypes#bytearray" title="bytearray"><code>bytearray</code></a> and like <a class="reference internal" href="../glossary#term-file-object"><span class="xref std std-term">file objects</span></a>. You can use mmap objects in most places where <a class="reference internal" href="stdtypes#bytearray" title="bytearray"><code>bytearray</code></a> are expected; for example, you can use the <a class="reference internal" href="re#module-re" title="re: Regular expression operations."><code>re</code></a> module to search through a memory-mapped file. You can also change a single byte by doing <code>obj[index] = 97</code>, or change a subsequence by assigning to a slice: <code>obj[i1:i2] = b'...'</code>. You can also read and write data starting at the current file position, and <code>seek()</code> through the file to different positions.</p> <p>A memory-mapped file is created by the <a class="reference internal" href="#mmap.mmap" title="mmap.mmap"><code>mmap</code></a> constructor, which is different on Unix and on Windows. In either case you must provide a file descriptor for a file opened for update. If you wish to map an existing Python file object, use its <a class="reference internal" href="io#io.IOBase.fileno" title="io.IOBase.fileno"><code>fileno()</code></a> method to obtain the correct value for the <em>fileno</em> parameter. Otherwise, you can open the file using the <a class="reference internal" href="os#os.open" title="os.open"><code>os.open()</code></a> function, which returns a file descriptor directly (the file still needs to be closed when done).</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>If you want to create a memory-mapping for a writable, buffered file, you should <a class="reference internal" href="io#io.IOBase.flush" title="io.IOBase.flush"><code>flush()</code></a> the file first. This is necessary to ensure that local modifications to the buffers are actually available to the mapping.</p> </div> <p>For both the Unix and Windows versions of the constructor, <em>access</em> may be specified as an optional keyword parameter. <em>access</em> accepts one of four values: <code>ACCESS_READ</code>, <code>ACCESS_WRITE</code>, or <code>ACCESS_COPY</code> to specify read-only, write-through or copy-on-write memory respectively, or <code>ACCESS_DEFAULT</code> to defer to <em>prot</em>. <em>access</em> can be used on both Unix and Windows. If <em>access</em> is not specified, Windows mmap returns a write-through mapping. The initial memory values for all three access types are taken from the specified file. Assignment to an <code>ACCESS_READ</code> memory map raises a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a> exception. Assignment to an <code>ACCESS_WRITE</code> memory map affects both memory and the underlying file. Assignment to an <code>ACCESS_COPY</code> memory map affects memory but does not update the underlying file.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>Added <code>ACCESS_DEFAULT</code> constant.</p> </div> <p>To map anonymous memory, -1 should be passed as the fileno along with the length.</p> <dl class="py class"> <dt class="sig sig-object py" id="mmap.mmap">
+<code>class mmap.mmap(fileno, length, tagname=None, access=ACCESS_DEFAULT[, offset])</code> </dt> <dd>
+<p><strong>(Windows version)</strong> Maps <em>length</em> bytes from the file specified by the file handle <em>fileno</em>, and creates a mmap object. If <em>length</em> is larger than the current size of the file, the file is extended to contain <em>length</em> bytes. If <em>length</em> is <code>0</code>, the maximum length of the map is the current size of the file, except that if the file is empty Windows raises an exception (you cannot create an empty mapping on Windows).</p> <p><em>tagname</em>, if specified and not <code>None</code>, is a string giving a tag name for the mapping. Windows allows you to have many different mappings against the same file. If you specify the name of an existing tag, that tag is opened, otherwise a new tag of this name is created. If this parameter is omitted or <code>None</code>, the mapping is created without a name. Avoiding the use of the tag parameter will assist in keeping your code portable between Unix and Windows.</p> <p><em>offset</em> may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. <em>offset</em> defaults to 0. <em>offset</em> must be a multiple of the <code>ALLOCATIONGRANULARITY</code>.</p> <p class="audit-hook">Raises an <a class="reference internal" href="sys#auditing"><span class="std std-ref">auditing event</span></a> <code>mmap.__new__</code> with arguments <code>fileno</code>, <code>length</code>, <code>access</code>, <code>offset</code>.</p> </dd>
+</dl> <dl class="py class"> <dt class="sig sig-object py"> <em class="property">class<span class="w"> </span></em><span class="sig-prename descclassname">mmap.</span><span class="sig-name descname">mmap</span><span class="sig-paren">(</span><em class="sig-param"><span class="n">fileno</span></em>, <em class="sig-param"><span class="n">length</span></em>, <em class="sig-param"><span class="n">flags=MAP_SHARED</span></em>, <em class="sig-param"><span class="n">prot=PROT_WRITE|PROT_READ</span></em>, <em class="sig-param"><span class="n">access=ACCESS_DEFAULT</span></em><span class="optional">[</span>, <em class="sig-param"><span class="n">offset</span></em><span class="optional">]</span><span class="sig-paren">)</span>
+</dt> <dd>
+<p><strong>(Unix version)</strong> Maps <em>length</em> bytes from the file specified by the file descriptor <em>fileno</em>, and returns a mmap object. If <em>length</em> is <code>0</code>, the maximum length of the map will be the current size of the file when <a class="reference internal" href="#mmap.mmap" title="mmap.mmap"><code>mmap</code></a> is called.</p> <p><em>flags</em> specifies the nature of the mapping. <a class="reference internal" href="#mmap.MAP_PRIVATE" title="mmap.MAP_PRIVATE"><code>MAP_PRIVATE</code></a> creates a private copy-on-write mapping, so changes to the contents of the mmap object will be private to this process, and <a class="reference internal" href="#mmap.MAP_SHARED" title="mmap.MAP_SHARED"><code>MAP_SHARED</code></a> creates a mapping that’s shared with all other processes mapping the same areas of the file. The default value is <a class="reference internal" href="#mmap.MAP_SHARED" title="mmap.MAP_SHARED"><code>MAP_SHARED</code></a>. Some systems have additional possible flags with the full list specified in <a class="reference internal" href="#map-constants"><span class="std std-ref">MAP_* constants</span></a>.</p> <p><em>prot</em>, if specified, gives the desired memory protection; the two most useful values are <code>PROT_READ</code> and <code>PROT_WRITE</code>, to specify that the pages may be read or written. <em>prot</em> defaults to <code>PROT_READ | PROT_WRITE</code>.</p> <p><em>access</em> may be specified in lieu of <em>flags</em> and <em>prot</em> as an optional keyword parameter. It is an error to specify both <em>flags</em>, <em>prot</em> and <em>access</em>. See the description of <em>access</em> above for information on how to use this parameter.</p> <p><em>offset</em> may be specified as a non-negative integer offset. mmap references will be relative to the offset from the beginning of the file. <em>offset</em> defaults to 0. <em>offset</em> must be a multiple of <code>ALLOCATIONGRANULARITY</code> which is equal to <code>PAGESIZE</code> on Unix systems.</p> <p>To ensure validity of the created memory mapping the file specified by the descriptor <em>fileno</em> is internally automatically synchronized with the physical backing store on macOS.</p> <p>This example shows a simple way of using <a class="reference internal" href="#mmap.mmap" title="mmap.mmap"><code>mmap</code></a>:</p> <pre data-language="python">import mmap
+
+# write a simple example file
+with open("hello.txt", "wb") as f:
+ f.write(b"Hello Python!\n")
+
+with open("hello.txt", "r+b") as f:
+ # memory-map the file, size 0 means whole file
+ mm = mmap.mmap(f.fileno(), 0)
+ # read content via standard file methods
+ print(mm.readline()) # prints b"Hello Python!\n"
+ # read content via slice notation
+ print(mm[:5]) # prints b"Hello"
+ # update content using slice notation;
+ # note that new content must have same size
+ mm[6:] = b" world!\n"
+ # ... and read again using standard file methods
+ mm.seek(0)
+ print(mm.readline()) # prints b"Hello world!\n"
+ # close the map
+ mm.close()
+</pre> <p><a class="reference internal" href="#mmap.mmap" title="mmap.mmap"><code>mmap</code></a> can also be used as a context manager in a <a class="reference internal" href="../reference/compound_stmts#with"><code>with</code></a> statement:</p> <pre data-language="python">import mmap
+
+with mmap.mmap(-1, 13) as mm:
+ mm.write(b"Hello world!")
+</pre> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2: </span>Context manager support.</p> </div> <p>The next example demonstrates how to create an anonymous map and exchange data between the parent and child processes:</p> <pre data-language="python">import mmap
+import os
+
+mm = mmap.mmap(-1, 13)
+mm.write(b"Hello world!")
+
+pid = os.fork()
+
+if pid == 0: # In a child process
+ mm.seek(0)
+ print(mm.readline())
+
+ mm.close()
+</pre> <p class="audit-hook">Raises an <a class="reference internal" href="sys#auditing"><span class="std std-ref">auditing event</span></a> <code>mmap.__new__</code> with arguments <code>fileno</code>, <code>length</code>, <code>access</code>, <code>offset</code>.</p> <p>Memory-mapped file objects support the following methods:</p> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.close">
+<code>close()</code> </dt> <dd>
+<p>Closes the mmap. Subsequent calls to other methods of the object will result in a ValueError exception being raised. This will not close the open file.</p> </dd>
+</dl> <dl class="py attribute"> <dt class="sig sig-object py" id="mmap.mmap.closed">
+<code>closed</code> </dt> <dd>
+<p><code>True</code> if the file is closed.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.find">
+<code>find(sub[, start[, end]])</code> </dt> <dd>
+<p>Returns the lowest index in the object where the subsequence <em>sub</em> is found, such that <em>sub</em> is contained in the range [<em>start</em>, <em>end</em>]. Optional arguments <em>start</em> and <em>end</em> are interpreted as in slice notation. Returns <code>-1</code> on failure.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Writable <a class="reference internal" href="../glossary#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a> is now accepted.</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.flush">
+<code>flush([offset[, size]])</code> </dt> <dd>
+<p>Flushes changes made to the in-memory copy of a file back to disk. Without use of this call there is no guarantee that changes are written back before the object is destroyed. If <em>offset</em> and <em>size</em> are specified, only changes to the given range of bytes will be flushed to disk; otherwise, the whole extent of the mapping is flushed. <em>offset</em> must be a multiple of the <code>PAGESIZE</code> or <code>ALLOCATIONGRANULARITY</code>.</p> <p><code>None</code> is returned to indicate success. An exception is raised when the call failed.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.8: </span>Previously, a nonzero value was returned on success; zero was returned on error under Windows. A zero value was returned on success; an exception was raised on error under Unix.</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.madvise">
+<code>madvise(option[, start[, length]])</code> </dt> <dd>
+<p>Send advice <em>option</em> to the kernel about the memory region beginning at <em>start</em> and extending <em>length</em> bytes. <em>option</em> must be one of the <a class="reference internal" href="#madvise-constants"><span class="std std-ref">MADV_* constants</span></a> available on the system. If <em>start</em> and <em>length</em> are omitted, the entire mapping is spanned. On some systems (including Linux), <em>start</em> must be a multiple of the <code>PAGESIZE</code>.</p> <p>Availability: Systems with the <code>madvise()</code> system call.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8.</span></p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.move">
+<code>move(dest, src, count)</code> </dt> <dd>
+<p>Copy the <em>count</em> bytes starting at offset <em>src</em> to the destination index <em>dest</em>. If the mmap was created with <code>ACCESS_READ</code>, then calls to move will raise a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a> exception.</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.read">
+<code>read([n])</code> </dt> <dd>
+<p>Return a <a class="reference internal" href="stdtypes#bytes" title="bytes"><code>bytes</code></a> containing up to <em>n</em> bytes starting from the current file position. If the argument is omitted, <code>None</code> or negative, return all bytes from the current file position to the end of the mapping. The file position is updated to point after the bytes that were returned.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.3: </span>Argument can be omitted or <code>None</code>.</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.read_byte">
+<code>read_byte()</code> </dt> <dd>
+<p>Returns a byte at the current file position as an integer, and advances the file position by 1.</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.readline">
+<code>readline()</code> </dt> <dd>
+<p>Returns a single line, starting at the current file position and up to the next newline. The file position is updated to point after the bytes that were returned.</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.resize">
+<code>resize(newsize)</code> </dt> <dd>
+<p>Resizes the map and the underlying file, if any. If the mmap was created with <code>ACCESS_READ</code> or <code>ACCESS_COPY</code>, resizing the map will raise a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a> exception.</p> <p><strong>On Windows</strong>: Resizing the map will raise an <a class="reference internal" href="exceptions#OSError" title="OSError"><code>OSError</code></a> if there are other maps against the same named file. Resizing an anonymous map (ie against the pagefile) will silently create a new map with the original data copied over up to the length of the new size.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.11: </span>Correctly fails if attempting to resize when another map is held Allows resize against an anonymous map on Windows</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.rfind">
+<code>rfind(sub[, start[, end]])</code> </dt> <dd>
+<p>Returns the highest index in the object where the subsequence <em>sub</em> is found, such that <em>sub</em> is contained in the range [<em>start</em>, <em>end</em>]. Optional arguments <em>start</em> and <em>end</em> are interpreted as in slice notation. Returns <code>-1</code> on failure.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Writable <a class="reference internal" href="../glossary#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a> is now accepted.</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.seek">
+<code>seek(pos[, whence])</code> </dt> <dd>
+<p>Set the file’s current position. <em>whence</em> argument is optional and defaults to <code>os.SEEK_SET</code> or <code>0</code> (absolute file positioning); other values are <code>os.SEEK_CUR</code> or <code>1</code> (seek relative to the current position) and <code>os.SEEK_END</code> or <code>2</code> (seek relative to the file’s end).</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.size">
+<code>size()</code> </dt> <dd>
+<p>Return the length of the file, which can be larger than the size of the memory-mapped area.</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.tell">
+<code>tell()</code> </dt> <dd>
+<p>Returns the current position of the file pointer.</p> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.write">
+<code>write(bytes)</code> </dt> <dd>
+<p>Write the bytes in <em>bytes</em> into memory at the current position of the file pointer and return the number of bytes written (never less than <code>len(bytes)</code>, since if the write fails, a <a class="reference internal" href="exceptions#ValueError" title="ValueError"><code>ValueError</code></a> will be raised). The file position is updated to point after the bytes that were written. If the mmap was created with <code>ACCESS_READ</code>, then writing to it will raise a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a> exception.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Writable <a class="reference internal" href="../glossary#term-bytes-like-object"><span class="xref std std-term">bytes-like object</span></a> is now accepted.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>The number of bytes written is now returned.</p> </div> </dd>
+</dl> <dl class="py method"> <dt class="sig sig-object py" id="mmap.mmap.write_byte">
+<code>write_byte(byte)</code> </dt> <dd>
+<p>Write the integer <em>byte</em> into memory at the current position of the file pointer; the file position is advanced by <code>1</code>. If the mmap was created with <code>ACCESS_READ</code>, then writing to it will raise a <a class="reference internal" href="exceptions#TypeError" title="TypeError"><code>TypeError</code></a> exception.</p> </dd>
+</dl> </dd>
+</dl> <section id="madv-constants"> <span id="madvise-constants"></span><h2>MADV_* Constants</h2> <dl class="py data"> <dt class="sig sig-object py" id="mmap.MADV_NORMAL">
+<code>mmap.MADV_NORMAL</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_RANDOM">
+<code>mmap.MADV_RANDOM</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_SEQUENTIAL">
+<code>mmap.MADV_SEQUENTIAL</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_WILLNEED">
+<code>mmap.MADV_WILLNEED</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_DONTNEED">
+<code>mmap.MADV_DONTNEED</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_REMOVE">
+<code>mmap.MADV_REMOVE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_DONTFORK">
+<code>mmap.MADV_DONTFORK</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_DOFORK">
+<code>mmap.MADV_DOFORK</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_HWPOISON">
+<code>mmap.MADV_HWPOISON</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_MERGEABLE">
+<code>mmap.MADV_MERGEABLE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_UNMERGEABLE">
+<code>mmap.MADV_UNMERGEABLE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_SOFT_OFFLINE">
+<code>mmap.MADV_SOFT_OFFLINE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_HUGEPAGE">
+<code>mmap.MADV_HUGEPAGE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_NOHUGEPAGE">
+<code>mmap.MADV_NOHUGEPAGE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_DONTDUMP">
+<code>mmap.MADV_DONTDUMP</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_DODUMP">
+<code>mmap.MADV_DODUMP</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_FREE">
+<code>mmap.MADV_FREE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_NOSYNC">
+<code>mmap.MADV_NOSYNC</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_AUTOSYNC">
+<code>mmap.MADV_AUTOSYNC</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_NOCORE">
+<code>mmap.MADV_NOCORE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_CORE">
+<code>mmap.MADV_CORE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_PROTECT">
+<code>mmap.MADV_PROTECT</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_FREE_REUSABLE">
+<code>mmap.MADV_FREE_REUSABLE</code> </dt> <dt class="sig sig-object py" id="mmap.MADV_FREE_REUSE">
+<code>mmap.MADV_FREE_REUSE</code> </dt> <dd>
+<p>These options can be passed to <a class="reference internal" href="#mmap.mmap.madvise" title="mmap.mmap.madvise"><code>mmap.madvise()</code></a>. Not every option will be present on every system.</p> <p>Availability: Systems with the madvise() system call.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8.</span></p> </div> </dd>
+</dl> </section> <section id="map-constants"> <span id="id1"></span><h2>MAP_* Constants</h2> <dl class="py data"> <dt class="sig sig-object py" id="mmap.MAP_SHARED">
+<code>mmap.MAP_SHARED</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_PRIVATE">
+<code>mmap.MAP_PRIVATE</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_DENYWRITE">
+<code>mmap.MAP_DENYWRITE</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_EXECUTABLE">
+<code>mmap.MAP_EXECUTABLE</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_ANON">
+<code>mmap.MAP_ANON</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_ANONYMOUS">
+<code>mmap.MAP_ANONYMOUS</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_POPULATE">
+<code>mmap.MAP_POPULATE</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_STACK">
+<code>mmap.MAP_STACK</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_ALIGNED_SUPER">
+<code>mmap.MAP_ALIGNED_SUPER</code> </dt> <dt class="sig sig-object py" id="mmap.MAP_CONCEAL">
+<code>mmap.MAP_CONCEAL</code> </dt> <dd>
+<p>These are the various flags that can be passed to <a class="reference internal" href="#mmap.mmap" title="mmap.mmap"><code>mmap.mmap()</code></a>. <a class="reference internal" href="#mmap.MAP_ALIGNED_SUPER" title="mmap.MAP_ALIGNED_SUPER"><code>MAP_ALIGNED_SUPER</code></a> is only available at FreeBSD and <a class="reference internal" href="#mmap.MAP_CONCEAL" title="mmap.MAP_CONCEAL"><code>MAP_CONCEAL</code></a> is only available at OpenBSD. Note that some options might not be present on some systems.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.10: </span>Added <a class="reference internal" href="#mmap.MAP_POPULATE" title="mmap.MAP_POPULATE"><code>MAP_POPULATE</code></a> constant.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.11: </span>Added <a class="reference internal" href="#mmap.MAP_STACK" title="mmap.MAP_STACK"><code>MAP_STACK</code></a> constant.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.12: </span>Added <a class="reference internal" href="#mmap.MAP_ALIGNED_SUPER" title="mmap.MAP_ALIGNED_SUPER"><code>MAP_ALIGNED_SUPER</code></a> constant. Added <a class="reference internal" href="#mmap.MAP_CONCEAL" title="mmap.MAP_CONCEAL"><code>MAP_CONCEAL</code></a> constant.</p> </div> </dd>
+</dl> </section> <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/mmap.html" class="_attribution-link">https://docs.python.org/3.12/library/mmap.html</a>
+ </p>
+</div>