[Python-Dev] Use function names instead of functions for os.supports_dir_fd? (original) (raw)
Victor Stinner victor.stinner at gmail.com
Tue Jul 17 19:34:05 CEST 2012
- Previous message: [Python-Dev] io.BytesIO slower than monkey-patching io.RawIOBase
- Next message: [Python-Dev] Use function names instead of functions for os.supports_dir_fd?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
Python 3.3 introduced os.supports_dir_fd to check if some os functions do accept a file descriptor instead of a path. The problem is that os.supports_dir_fd is a list of functions, not a list of function names. If os functions are monkey patched, you cannot test anymore if a function supports file descriptor.
Monkey patching is a common practice in Python. test_os.py replaces os.exec*() functions temporary for example.
It's also inconsistent with the new time.get_clock_info() function which expects the name of a time function, not the function directly.
Victor
- Previous message: [Python-Dev] io.BytesIO slower than monkey-patching io.RawIOBase
- Next message: [Python-Dev] Use function names instead of functions for os.supports_dir_fd?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]