[docs] Add examples for open’s new opener argument (issue 13424)

storchaka at gmail.com storchaka at gmail.com
Sat Nov 3 22:11:54 CET 2012


http://bugs.python.org/review/13424/diff/6494/Doc/library/functions.rst
File Doc/library/functions.rst (right):

http://bugs.python.org/review/13424/diff/6494/Doc/library/functions.rst#newcode938
Doc/library/functions.rst:938: The following example is an alternative
implementation for opening files
I doubt that an alternative implementation is a good usage example. 
First, this violates the "one obvious way" principle.  Second, this does
not justify the adding of the new parameter to already complicated
open(), because you can do this without it.

http://bugs.python.org/review/13424/diff/6494/Doc/library/functions.rst#newcode959
Doc/library/functions.rst:959: ...     dir_fd = os.open(dirname,
os.O_RDONLY)
Here is a file descriptor leak.

http://bugs.python.org/review/13424/


More information about the docs mailing list