destination of the symlink will be copied. *update* and *verbose* are the same
as for :func:`copy_file`.
- .. versionchanged:: 3.2.4
+ Files in *src* that begin with :file:`.nfs` are skipped (more information on
+ these files is available in answer D2 of the `NFS FAQ page
+ <http://nfs.sourceforge.net/#section_d>`_.
+
++ .. versionchanged:: 3.3.1
+ NFS files are ignored.
.. function:: remove_tree(directory[, verbose=0, dry_run=0])
available as a method of ``Foo``, so it is provided separately.
-It also provides the following decorators:
+The :mod:`abc` module also provides the following decorators:
- .. decorator:: abstractmethod(function)
+ .. decorator:: abstractmethod
A decorator indicating abstract methods.
...
.. versionadded:: 3.2
+ .. deprecated:: 3.3
+ It is now possible to use :class:`classmethod` with
+ :func:`abstractmethod`, making this decorator redundant.
- .. decorator:: abstractstaticmethod(function)
+ .. decorator:: abstractstaticmethod
A subclass of the built-in :func:`staticmethod`, indicating an abstract
staticmethod. Otherwise it is similar to :func:`abstractmethod`.
:class:`str` data.
Note that calling any method (even inquiries) on a closed stream is
- undefined. Implementations may raise :exc:`IOError` in this case.
+ undefined. Implementations may raise :exc:`ValueError` in this case.
- :class:`IOBase` (and its subclasses) support the iterator protocol, meaning
- IOBase (and its subclasses) supports the iterator protocol, meaning that an
- :class:`IOBase` object can be iterated over yielding the lines in a stream.
- Lines are defined slightly differently depending on whether the stream is
- a binary stream (yielding bytes), or a text stream (yielding character
- strings). See :meth:`~IOBase.readline` below.
++ :class:`IOBase` (and its subclasses) supports the iterator protocol, meaning
+ that an :class:`IOBase` object can be iterated over yielding the lines in a
+ stream. Lines are defined slightly differently depending on whether the
+ stream is a binary stream (yielding bytes), or a text stream (yielding
+ character strings). See :meth:`~IOBase.readline` below.
- IOBase is also a context manager and therefore supports the
+ :class:`IOBase` is also a context manager and therefore supports the
:keyword:`with` statement. In this example, *file* is closed after the
:keyword:`with` statement's suite is finished---even if an exception occurs::
elif sys.platform.startswith('linux'):
# Linux-specific code here...
- .. versionchanged:: 3.2.2
- Since lots of code check for ``sys.platform == 'linux2'``, and there is
- no essential change between Linux 2.x and 3.x, ``sys.platform`` is always
- set to ``'linux2'``, even on Linux 3.x. In Python 3.3 and later, the
- value will always be set to ``'linux'``, so it is recommended to always
- use the ``startswith`` idiom presented above.
-
For other systems, the values are:
- ====================== ===========================
- System ``platform`` value
- ====================== ===========================
- Linux (2.x *and* 3.x) ``'linux2'``
- Windows ``'win32'``
- Windows/Cygwin ``'cygwin'``
- Mac OS X ``'darwin'``
- OS/2 ``'os2'``
- OS/2 EMX ``'os2emx'``
- ====================== ===========================
+ ================ ===========================
- System :data:`platform` value
++ System ``platform`` value
+ ================ ===========================
+ Linux ``'linux'``
+ Windows ``'win32'``
+ Windows/Cygwin ``'cygwin'``
+ Mac OS X ``'darwin'``
+ OS/2 ``'os2'``
+ OS/2 EMX ``'os2emx'``
+ ================ ===========================
+
+ .. versionchanged:: 3.3
+ On Linux, :attr:`sys.platform` doesn't contain the major version anymore.
+ It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since
+ older Python versions include the version number, it is recommended to
+ always use the ``startswith`` idiom presented above.
.. seealso::
Drew Jenkins
Flemming Kjær Jensen
Philip H. Jensen
+ Philip Jenvey
MunSic Jeong
Chris Jerdonek
+Jim Jewett
Pedro Diaz Jimenez
Orjan Johansen
Fredrik Johansson
Julia Lawall
Chris Lawrence
Brian Leair
+Mathieu Leduc-Hamel
+Christopher Lee
+Inyeol Lee
James Lee
John J. Lee
-Inyeol Lee
Thomas Lee
-Christopher Lee
Tennessee Leeuwenburg
Luc Lefebvre
+ Pierre Paul Lefebvre
Glyph Lefkowitz
Vincent Legoll
Kip Lehman