Merged revisions 82793-82794,82807,82876,83432 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/release27-maint

................
  r82793 | georg.brandl | 2010-07-11 10:56:18 +0200 (So, 11 Jul 2010) | 9 lines

  Merged revisions 82790 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r82790 | georg.brandl | 2010-07-11 10:36:20 +0200 (So, 11 Jul 2010) | 1 line

    #3214 followup: add link to ABC entry.
  ........
................
  r82794 | georg.brandl | 2010-07-11 10:57:05 +0200 (So, 11 Jul 2010) | 9 lines

  Merged revisions 82789 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r82789 | georg.brandl | 2010-07-11 10:33:16 +0200 (So, 11 Jul 2010) | 1 line

    Silence makeindex.
  ........
................
  r82807 | georg.brandl | 2010-07-11 12:29:37 +0200 (So, 11 Jul 2010) | 9 lines

  Merged revisions 82806 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r82806 | georg.brandl | 2010-07-11 12:22:44 +0200 (So, 11 Jul 2010) | 1 line

    #9223: link to Command class reference, and move Command interface docs nearer to class docs.
  ........
................
  r82876 | georg.brandl | 2010-07-14 10:55:55 +0200 (Mi, 14 Jul 2010) | 13 lines

  Merged revisions 82872,82874 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r82872 | georg.brandl | 2010-07-14 10:53:18 +0200 (Mi, 14 Jul 2010) | 1 line

    Remove XXX from text.
  ........
    r82874 | georg.brandl | 2010-07-14 10:54:40 +0200 (Mi, 14 Jul 2010) | 1 line

    #9235: fix missing import of sys.
  ........
................
  r83432 | georg.brandl | 2010-08-01 21:21:26 +0200 (So, 01 Aug 2010) | 13 lines

  Merged revisions 83328,83341 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r83328 | raymond.hettinger | 2010-07-31 12:14:41 +0200 (Sa, 31 Jul 2010) | 1 line

    Document how to change OrderedDict update order from first to last.
  ........
    r83341 | georg.brandl | 2010-07-31 13:40:07 +0200 (Sa, 31 Jul 2010) | 1 line

    #9430: document timedelta str() and repr().
  ........
................
This commit is contained in:
Georg Brandl 2010-08-01 22:19:17 +00:00
parent d9ede202ea
commit bde4998c65
5 changed files with 26 additions and 6 deletions

View file

@ -143,6 +143,7 @@ dist:
# archive the A4 latex # archive the A4 latex
-rm -r build/latex -rm -r build/latex
make latex PAPER=a4 make latex PAPER=a4
-sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-a4.zip
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2 cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
@ -150,6 +151,7 @@ dist:
# archive the letter latex # archive the letter latex
rm -r build/latex rm -r build/latex
make latex PAPER=letter make latex PAPER=letter
-sed -i 's/makeindex/makeindex -q/' build/latex/Makefile
(cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2) (cd build/latex; make clean && make all-pdf && make FMT=pdf zip bz2)
cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip cp build/latex/docs-pdf.zip dist/python-$(DISTVERSION)-docs-pdf-letter.zip
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2 cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-letter.tar.bz2

View file

@ -21,7 +21,7 @@ setup script). Indirectly provides the :class:`distutils.dist.Distribution` and
.. function:: setup(arguments) .. function:: setup(arguments)
The basic do-everything function that does most everything you could ever ask The basic do-everything function that does most everything you could ever ask
for from a Distutils method. See XXXXX for from a Distutils method.
The setup function takes a large number of arguments. These are laid out in the The setup function takes a large number of arguments. These are laid out in the
following table. following table.

View file

@ -15,8 +15,8 @@ want to modify existing commands; many simply add a few file extensions that
should be copied into packages in addition to :file:`.py` files as a should be copied into packages in addition to :file:`.py` files as a
convenience. convenience.
Most distutils command implementations are subclasses of the :class:`Command` Most distutils command implementations are subclasses of the
class from :mod:`distutils.cmd`. New commands may directly inherit from :class:`distutils.cmd.Command` class. New commands may directly inherit from
:class:`Command`, while replacements often derive from :class:`Command` :class:`Command`, while replacements often derive from :class:`Command`
indirectly, directly subclassing the command they are replacing. Commands are indirectly, directly subclassing the command they are replacing. Commands are
required to derive from :class:`Command`. required to derive from :class:`Command`.

View file

@ -161,8 +161,8 @@ Glossary
well-designed code improves its flexibility by allowing polymorphic well-designed code improves its flexibility by allowing polymorphic
substitution. Duck-typing avoids tests using :func:`type` or substitution. Duck-typing avoids tests using :func:`type` or
:func:`isinstance`. (Note, however, that duck-typing can be complemented :func:`isinstance`. (Note, however, that duck-typing can be complemented
with abstract base classes.) Instead, it typically employs :func:`hasattr` with :term:`abstract base class`\ es.) Instead, it typically employs
tests or :term:`EAFP` programming. :func:`hasattr` tests or :term:`EAFP` programming.
EAFP EAFP
Easier to ask for forgiveness than permission. This common Python coding Easier to ask for forgiveness than permission. This common Python coding

View file

@ -235,6 +235,14 @@ Supported operations:
| ``abs(t)`` | equivalent to +\ *t* when ``t.days >= 0``, and| | ``abs(t)`` | equivalent to +\ *t* when ``t.days >= 0``, and|
| | to -*t* when ``t.days < 0``. (2) | | | to -*t* when ``t.days < 0``. (2) |
+--------------------------------+-----------------------------------------------+ +--------------------------------+-----------------------------------------------+
| ``str(t)`` | Returns a string in the form |
| | ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D |
| | is negative for negative ``t``. (5) |
+--------------------------------+-----------------------------------------------+
| ``repr(t)`` | Returns a string in the form |
| | ``datetime.timedelta(D[, S[, U]])``, where D |
| | is negative for negative ``t``. (5) |
+--------------------------------+-----------------------------------------------+
Notes: Notes:
@ -250,6 +258,16 @@ Notes:
(4) (4)
-*timedelta.max* is not representable as a :class:`timedelta` object. -*timedelta.max* is not representable as a :class:`timedelta` object.
(5)
String representations of :class:`timedelta` objects are normalized
similarly to their internal representation. This leads to somewhat
unusual results for negative timedeltas. For example:
>>> timedelta(hours=-5)
datetime.timedelta(-1, 68400)
>>> print(_)
-1 day, 19:00:00
In addition to the operations listed above :class:`timedelta` objects support In addition to the operations listed above :class:`timedelta` objects support
certain additions and subtractions with :class:`date` and :class:`datetime` certain additions and subtractions with :class:`date` and :class:`datetime`
objects (see below). objects (see below).