diff options
author | Raymond Hettinger <python@rcn.com> | 2011-01-25 07:46:07 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-01-25 07:46:07 (GMT) |
commit | da4a05de7eaa1396ad12c5b48def6f11d4214a87 (patch) | |
tree | 7a2e4408e1d7b4c1c8c696dd6ec6a190215cfbeb | |
parent | 2f707c98fbace947219d05a4b1ab37abd63e0e96 (diff) | |
download | cpython-da4a05de7eaa1396ad12c5b48def6f11d4214a87.zip cpython-da4a05de7eaa1396ad12c5b48def6f11d4214a87.tar.gz cpython-da4a05de7eaa1396ad12c5b48def6f11d4214a87.tar.bz2 |
Add entries for select and site.
-rw-r--r-- | Doc/whatsnew/3.2.rst | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index b96132a..0c8eee0 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -1259,6 +1259,20 @@ popen The :func:`os.popen` and :func:`subprocess.Popen` functions now support :keyword:`with` statements for auto-closing of the file descriptors. +select +------ + +The :mod:`select` module now exposes a new, constant attribute, +:attr:`~select.PIPE_BUF`, which gives the minimum number of files that are +guaranteed to not block on a write by the :func:`~select.select` or +:func:`~select.poll` functions. + +>>> import select +>>> select.PIPE_BUF +512 + +(Available on Unix systems.) + gzip and zipfile ---------------- @@ -1757,6 +1771,39 @@ ctypes A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` datatype. +site +---- + +The :mod:`site` module has three new functions useful for reporting on the +details of a given Python installation. + +* :func:`~site.getsitepackages` lists all global site-packages directories. + +* :func:`~site.getuserbase` reports on the user's base directory where data can + be stored. + +* :func:`~site.getusersitepackages` reveals the user-specific site-packages + directory path. + +:: + + >>> site.getsitepackages() + ['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages', + '/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python', + '/Library/Python/3.2/site-packages'] + >>> site.getuserbase() + '/Users/raymondhettinger/Library/Python/3.2' + >>> site.getusersitepackages() + '/Users/raymondhettinger/Library/Python/3.2/lib/python/site-packages' + +Conveniently, some of site's functionality is accessible directly from the +command-line:: + + $ python -m site --user-base + /Users/raymondhettinger/.local + $ python -m site --user-site + /Users/raymondhettinger/.local/lib/python3.2/site-packages + sysconfig --------- |