diff -r da3f4774b939 Doc/library/mmap.rst --- a/Doc/library/mmap.rst Mon Mar 11 09:14:09 2013 +0200 +++ b/Doc/library/mmap.rst Tue Mar 12 17:18:30 2013 +0530 @@ -114,19 +114,19 @@ with open("hello.txt", "r+b") as f: # memory-map the file, size 0 means whole file - map = mmap.mmap(f.fileno(), 0) + mymap = mmap.mmap(f.fileno(), 0) # read content via standard file methods - print map.readline() # prints "Hello Python!" + print mymap.readline() # prints "Hello Python!" # read content via slice notation - print map[:5] # prints "Hello" + print mymap[:5] # prints "Hello" # update content using slice notation; # note that new content must have same size - map[6:] = " world!\n" + mymap[6:] = " world!\n" # ... and read again using standard file methods - map.seek(0) - print map.readline() # prints "Hello world!" + mymap.seek(0) + print mymap.readline() # prints "Hello world!" # close the map - map.close() + mymap.close() The next example demonstrates how to create an anonymous map and exchange @@ -135,16 +135,16 @@ import mmap import os - map = mmap.mmap(-1, 13) - map.write("Hello world!") + mymap = mmap.mmap(-1, 13) + mymap.write("Hello world!") pid = os.fork() if pid == 0: # In a child process - map.seek(0) - print map.readline() + mymap.seek(0) + print mymap.readline() - map.close() + mymap.close() Memory-mapped file objects support the following methods: