Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da4a05d

Browse files
committed
Add entries for select and site.
1 parent 2f707c9 commit da4a05d

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Doc/whatsnew/3.2.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,20 @@ popen
12591259
The :func:`os.popen` and :func:`subprocess.Popen` functions now support
12601260
:keyword:`with` statements for auto-closing of the file descriptors.
12611261

1262+
select
1263+
------
1264+
1265+
The :mod:`select` module now exposes a new, constant attribute,
1266+
:attr:`~select.PIPE_BUF`, which gives the minimum number of files that are
1267+
guaranteed to not block on a write by the :func:`~select.select` or
1268+
:func:`~select.poll` functions.
1269+
1270+
>>> import select
1271+
>>> select.PIPE_BUF
1272+
512
1273+
1274+
(Available on Unix systems.)
1275+
12621276
gzip and zipfile
12631277
----------------
12641278

@@ -1757,6 +1771,39 @@ ctypes
17571771

17581772
A new type, :class:`ctypes.c_ssize_t` represents the C :c:type:`ssize_t` datatype.
17591773

1774+
site
1775+
----
1776+
1777+
The :mod:`site` module has three new functions useful for reporting on the
1778+
details of a given Python installation.
1779+
1780+
* :func:`~site.getsitepackages` lists all global site-packages directories.
1781+
1782+
* :func:`~site.getuserbase` reports on the user's base directory where data can
1783+
be stored.
1784+
1785+
* :func:`~site.getusersitepackages` reveals the user-specific site-packages
1786+
directory path.
1787+
1788+
::
1789+
1790+
>>> site.getsitepackages()
1791+
['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages',
1792+
'/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python',
1793+
'/Library/Python/3.2/site-packages']
1794+
>>> site.getuserbase()
1795+
'/Users/raymondhettinger/Library/Python/3.2'
1796+
>>> site.getusersitepackages()
1797+
'/Users/raymondhettinger/Library/Python/3.2/lib/python/site-packages'
1798+
1799+
Conveniently, some of site's functionality is accessible directly from the
1800+
command-line::
1801+
1802+
$ python -m site --user-base
1803+
/Users/raymondhettinger/.local
1804+
$ python -m site --user-site
1805+
/Users/raymondhettinger/.local/lib/python3.2/site-packages
1806+
17601807
sysconfig
17611808
---------
17621809

0 commit comments

Comments
 (0)