File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ byte by doing ``obj[index] = 97``, or change a subsequence by assigning to a
1616slice: ``obj[i1:i2] = b'...' ``.  You can also read and write data starting at
1717the current file position, and :meth: `seek ` through the file to different positions.
1818
19+ .. note ::
20+    Iterating over a mmap object yields :class: `bytes ` objects of length 1; this
21+    differs from :class: `bytearray ` which yields :class: `int ` values in the range
22+    [0, 255]. This behavior has been retained for backwards-compatibility. To get
23+    an iterator that iterates over bytes you can create a :class: `memoryview ` object
24+    referencing the mmap object.
25+ 
1926A memory-mapped file is created by the :class: `~mmap.mmap ` constructor, which is
2027different on Unix and on Windows.  In either case you must provide a file
2128descriptor for a file opened for update. If you wish to map an existing Python
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments