Skip to content

Commit b558a2e

Browse files
committed
Merged revisions 61143-61144,61146-61147,61150-61151,61157,61165-61168,61170-61173,61176-61177,61183 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61143 | barry.warsaw | 2008-03-01 03:23:38 +0100 (Sat, 01 Mar 2008) | 2 lines Bump to version 2.6a1 ........ r61144 | barry.warsaw | 2008-03-01 03:26:42 +0100 (Sat, 01 Mar 2008) | 1 line bump idle version number ........ r61146 | fred.drake | 2008-03-01 03:45:07 +0100 (Sat, 01 Mar 2008) | 2 lines fix typo ........ r61147 | barry.warsaw | 2008-03-01 03:53:36 +0100 (Sat, 01 Mar 2008) | 1 line Add date to NEWS ........ r61150 | barry.warsaw | 2008-03-01 04:00:52 +0100 (Sat, 01 Mar 2008) | 1 line Give IDLE a release date ........ r61151 | barry.warsaw | 2008-03-01 04:15:20 +0100 (Sat, 01 Mar 2008) | 1 line More copyright year and version number bumps ........ r61157 | barry.warsaw | 2008-03-01 18:11:41 +0100 (Sat, 01 Mar 2008) | 2 lines Set things up for 2.6a2. ........ r61165 | georg.brandl | 2008-03-02 07:28:16 +0100 (Sun, 02 Mar 2008) | 2 lines It's 2.6 now. ........ r61166 | georg.brandl | 2008-03-02 07:32:32 +0100 (Sun, 02 Mar 2008) | 2 lines Update year. ........ r61167 | georg.brandl | 2008-03-02 07:44:08 +0100 (Sun, 02 Mar 2008) | 2 lines Make patchlevel print out the release if called as a script. ........ r61168 | georg.brandl | 2008-03-02 07:45:40 +0100 (Sun, 02 Mar 2008) | 2 lines New default basename for HTML help files. ........ r61170 | raymond.hettinger | 2008-03-02 11:59:31 +0100 (Sun, 02 Mar 2008) | 1 line Finish-up docs for combinations() and permutations() in itertools. ........ r61171 | raymond.hettinger | 2008-03-02 12:17:51 +0100 (Sun, 02 Mar 2008) | 1 line Tighten example code. ........ r61172 | raymond.hettinger | 2008-03-02 12:57:16 +0100 (Sun, 02 Mar 2008) | 1 line Simplify code for itertools.product(). ........ r61173 | raymond.hettinger | 2008-03-02 13:02:19 +0100 (Sun, 02 Mar 2008) | 1 line Handle 0-tuples which can be singletons. ........ r61176 | georg.brandl | 2008-03-02 14:41:39 +0100 (Sun, 02 Mar 2008) | 2 lines Make clear that the constants are strings. ........ r61177 | georg.brandl | 2008-03-02 15:15:04 +0100 (Sun, 02 Mar 2008) | 2 lines Fix factual error. ........ r61183 | gregory.p.smith | 2008-03-02 21:00:53 +0100 (Sun, 02 Mar 2008) | 4 lines Modify import of test_support so that the code can also be used with a stand alone distribution of bsddb that includes its own small copy of test_support for the needed functionality on older pythons. ........
1 parent b0bf4b7 commit b558a2e

23 files changed

+135
-63
lines changed

Doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
}
8888

8989
# Output file base name for HTML help builder.
90-
htmlhelp_basename = 'pydoc'
90+
htmlhelp_basename = 'python' + release.replace('.', '')
9191

9292

9393
# Options for LaTeX output

Doc/copyright.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright
44

55
Python and this documentation is:
66

7-
Copyright © 2001-2007 Python Software Foundation. All rights reserved.
7+
Copyright © 2001-2008 Python Software Foundation. All rights reserved.
88

99
Copyright © 2000 BeOpen.com. All rights reserved.
1010

Doc/library/itertools.rst

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,24 @@ loops that truncate the stream.
102102
Each result tuple is ordered to match the input order. So, every
103103
combination is a subsequence of the input *iterable*.
104104

105-
Example: ``combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)``
106-
107105
Equivalent to::
108106

109107
def combinations(iterable, r):
108+
'combinations(range(4), 3) --> (0,1,2) (0,1,3) (0,2,3) (1,2,3)'
110109
pool = tuple(iterable)
111110
n = len(pool)
112-
assert 0 <= r <= n
113-
vec = range(r)
114-
yield tuple(pool[i] for i in vec)
111+
indices = range(r)
112+
yield tuple(pool[i] for i in indices)
115113
while 1:
116114
for i in reversed(range(r)):
117-
if vec[i] != i + n - r:
115+
if indices[i] != i + n - r:
118116
break
119117
else:
120118
return
121-
vec[i] += 1
119+
indices[i] += 1
122120
for j in range(i+1, r):
123-
vec[j] = vec[j-1] + 1
124-
yield tuple(pool[i] for i in vec)
121+
indices[j] = indices[j-1] + 1
122+
yield tuple(pool[i] for i in indices)
125123

126124
.. versionadded:: 2.6
127125

@@ -356,7 +354,29 @@ loops that truncate the stream.
356354
value. So if the input elements are unique, there will be no repeat
357355
values in each permutation.
358356

359-
Example: ``permutations(range(3),2) --> (1,2) (1,3) (2,1) (2,3) (3,1) (3,2)``
357+
Equivalent to::
358+
359+
def permutations(iterable, r=None):
360+
'permutations(range(3), 2) --> (0,1) (0,2) (1,0) (1,2) (2,0) (2,1)'
361+
pool = tuple(iterable)
362+
n = len(pool)
363+
r = n if r is None else r
364+
indices = range(n)
365+
cycles = range(n-r+1, n+1)[::-1]
366+
yield tuple(pool[i] for i in indices[:r])
367+
while n:
368+
for i in reversed(range(r)):
369+
cycles[i] -= 1
370+
if cycles[i] == 0:
371+
indices[i:] = indices[i+1:] + indices[i:i+1]
372+
cycles[i] = n - i
373+
else:
374+
j = cycles[i]
375+
indices[i], indices[-j] = indices[-j], indices[i]
376+
yield tuple(pool[i] for i in indices[:r])
377+
break
378+
else:
379+
return
360380

361381
.. versionadded:: 2.6
362382

Doc/library/logging.rst

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,27 +1630,28 @@ timed intervals.
16301630
You can use the *when* to specify the type of *interval*. The list of possible
16311631
values is, note that they are not case sensitive:
16321632

1633-
+----------+-----------------------+
1634-
| Value | Type of interval |
1635-
+==========+=======================+
1636-
| S | Seconds |
1637-
+----------+-----------------------+
1638-
| M | Minutes |
1639-
+----------+-----------------------+
1640-
| H | Hours |
1641-
+----------+-----------------------+
1642-
| D | Days |
1643-
+----------+-----------------------+
1644-
| W | Week day (0=Monday) |
1645-
+----------+-----------------------+
1646-
| midnight | Roll over at midnight |
1647-
+----------+-----------------------+
1648-
1649-
If *backupCount* is non-zero, the system will save old log files by appending
1650-
extensions to the filename. The extensions are date-and-time based, using the
1651-
strftime format ``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on
1652-
the rollover interval. At most *backupCount* files will be kept, and if more
1653-
would be created when rollover occurs, the oldest one is deleted.
1633+
+----------------+-----------------------+
1634+
| Value | Type of interval |
1635+
+================+=======================+
1636+
| ``'S'`` | Seconds |
1637+
+----------------+-----------------------+
1638+
| ``'M'`` | Minutes |
1639+
+----------------+-----------------------+
1640+
| ``'H'`` | Hours |
1641+
+----------------+-----------------------+
1642+
| ``'D'`` | Days |
1643+
+----------------+-----------------------+
1644+
| ``'W'`` | Week day (0=Monday) |
1645+
+----------------+-----------------------+
1646+
| ``'midnight'`` | Roll over at midnight |
1647+
+----------------+-----------------------+
1648+
1649+
The system will save old log files by appending extensions to the filename.
1650+
The extensions are date-and-time based, using the strftime format
1651+
``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on the rollover
1652+
interval. If *backupCount* is nonzero, at most *backupCount* files will be
1653+
kept, and if more would be created when rollover occurs, the oldest one is
1654+
deleted.
16541655

16551656

16561657
.. method:: TimedRotatingFileHandler.doRollover()

Doc/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Terms and conditions for accessing or otherwise using Python
120120
analyze, test, perform and/or display publicly, prepare derivative works,
121121
distribute, and otherwise use Python |release| alone or in any derivative
122122
version, provided, however, that PSF's License Agreement and PSF's notice of
123-
copyright, i.e., "Copyright © 2001-2007 Python Software Foundation; All Rights
123+
copyright, i.e., "Copyright © 2001-2008 Python Software Foundation; All Rights
124124
Reserved" are retained in Python |release| alone or in any derivative version
125125
prepared by Licensee.
126126

Doc/tools/sphinxext/patchlevel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ def get_version_info():
6666
print >>sys.stderr, 'Can\'t get version info from Include/patchlevel.h, ' \
6767
'using version of this interpreter (%s).' % release
6868
return version, release
69+
70+
if __name__ == '__main__':
71+
print get_header_version_info('.')[1]

Lib/bsddb/test/test_associate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
# For Python 2.3
2525
from bsddb import db, dbshelve
2626

27+
try:
28+
from bsddb3 import test_support
29+
except ImportError:
30+
from test import test_support
31+
2732

2833
#----------------------------------------------------------------------
2934

@@ -107,7 +112,6 @@ def setUp(self):
107112
def tearDown(self):
108113
self.env.close()
109114
self.env = None
110-
from test import test_support
111115
test_support.rmtree(self.homeDir)
112116

113117
def test00_associateDBError(self):

Lib/bsddb/test/test_basics.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import string
1010
import tempfile
1111
from pprint import pprint
12-
from test import test_support
1312
import unittest
1413
import time
1514

@@ -21,6 +20,10 @@
2120
from bsddb import db
2221

2322
from bsddb.test.test_all import verbose
23+
try:
24+
from bsddb3 import test_support
25+
except ImportError:
26+
from test import test_support
2427

2528
DASH = b'-'
2629
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

Lib/bsddb/test/test_compare.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
# For Python 2.3
1717
from bsddb import db, dbshelve
1818

19+
try:
20+
from bsddb3 import test_support
21+
except ImportError:
22+
from test import test_support
23+
1924
lexical_cmp = cmp
2025

2126
def lowercase_cmp(left, right):
@@ -84,7 +89,6 @@ def tearDown (self):
8489
if self.env is not None:
8590
self.env.close ()
8691
self.env = None
87-
from test import test_support
8892
test_support.rmtree(self.homeDir)
8993

9094
def addDataToDB (self, data):

Lib/bsddb/test/test_cursor_pget_bug.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
from bsddb import db
88

9+
try:
10+
from bsddb3 import test_support
11+
except ImportError:
12+
from test import test_support
13+
914

1015
#----------------------------------------------------------------------
1116

@@ -39,7 +44,6 @@ def tearDown(self):
3944
del self.secondary_db
4045
del self.primary_db
4146
del self.env
42-
from test import test_support
4347
test_support.rmtree(self.homeDir)
4448

4549
def test_pget(self):

0 commit comments

Comments
 (0)