Skip to content

Commit f9f945e

Browse files
author
georg.brandl
committed
Merged revisions 65012,65035,65037-65040,65048,65057,65077,65091-65095,65097-65099,65127-65128,65131,65133-65136,65139,65149-65151,65155,65158-65159,65176-65178,65183-65184,65187-65190,65192,65194 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65012 | jesse.noller | 2008-07-16 15:24:06 +0200 (Wed, 16 Jul 2008) | 2 lines Apply patch for issue 3090: ARCHFLAGS parsing incorrect ........ r65035 | georg.brandl | 2008-07-16 23:19:28 +0200 (Wed, 16 Jul 2008) | 2 lines #3045: fix pydoc behavior for TEMP path with spaces. ........ r65037 | georg.brandl | 2008-07-16 23:31:41 +0200 (Wed, 16 Jul 2008) | 2 lines #1608818: errno can get set by every call to readdir(). ........ r65038 | georg.brandl | 2008-07-17 00:04:20 +0200 (Thu, 17 Jul 2008) | 2 lines #3305: self->stream can be NULL. ........ r65039 | georg.brandl | 2008-07-17 00:09:17 +0200 (Thu, 17 Jul 2008) | 2 lines #3345: fix docstring. ........ r65040 | georg.brandl | 2008-07-17 00:33:18 +0200 (Thu, 17 Jul 2008) | 2 lines #3312: fix two sqlite3 crashes. ........ r65048 | georg.brandl | 2008-07-17 01:35:54 +0200 (Thu, 17 Jul 2008) | 2 lines #3388: add a paragraph about using "with" for file objects. ........ r65057 | gregory.p.smith | 2008-07-17 05:13:05 +0200 (Thu, 17 Jul 2008) | 2 lines news note for r63052 ........ r65077 | jesse.noller | 2008-07-17 23:01:05 +0200 (Thu, 17 Jul 2008) | 3 lines Fix issue 3395, update _debugInfo to be _debug_info ........ r65091 | ronald.oussoren | 2008-07-18 07:48:03 +0200 (Fri, 18 Jul 2008) | 2 lines Last bit of a fix for issue3381 (addon for my patch in r65061) ........ r65092 | vinay.sajip | 2008-07-18 10:59:06 +0200 (Fri, 18 Jul 2008) | 1 line Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. ........ r65093 | vinay.sajip | 2008-07-18 11:00:00 +0200 (Fri, 18 Jul 2008) | 1 line Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. ........ r65094 | vinay.sajip | 2008-07-18 11:00:35 +0200 (Fri, 18 Jul 2008) | 1 line Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. ........ r65095 | vinay.sajip | 2008-07-18 11:01:10 +0200 (Fri, 18 Jul 2008) | 1 line Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. ........ r65097 | georg.brandl | 2008-07-18 12:20:59 +0200 (Fri, 18 Jul 2008) | 2 lines Remove duplicate entry in __all__. ........ r65098 | georg.brandl | 2008-07-18 12:29:30 +0200 (Fri, 18 Jul 2008) | 2 lines Correct attribute name. ........ r65099 | georg.brandl | 2008-07-18 13:15:06 +0200 (Fri, 18 Jul 2008) | 3 lines Document the different meaning of precision for {:f} and {:g}. Also document how inf and nan are formatted. #3404. ........ r65127 | raymond.hettinger | 2008-07-19 02:42:03 +0200 (Sat, 19 Jul 2008) | 1 line Improve accuracy of gamma test function ........ r65128 | raymond.hettinger | 2008-07-19 02:43:00 +0200 (Sat, 19 Jul 2008) | 1 line Add recipe to the itertools docs. ........ r65131 | georg.brandl | 2008-07-19 12:08:55 +0200 (Sat, 19 Jul 2008) | 2 lines #3378: in case of no memory, don't leak even more memory. :) ........ r65133 | georg.brandl | 2008-07-19 14:39:10 +0200 (Sat, 19 Jul 2008) | 3 lines #3302: fix segfaults when passing None for arguments that can't be NULL for the C functions. ........ r65134 | georg.brandl | 2008-07-19 14:46:12 +0200 (Sat, 19 Jul 2008) | 2 lines #3303: fix crash with invalid Py_DECREF in strcoll(). ........ r65135 | georg.brandl | 2008-07-19 15:00:22 +0200 (Sat, 19 Jul 2008) | 3 lines #3319: don't raise ZeroDivisionError if number of rounds is so low that benchtime is zero. ........ r65136 | georg.brandl | 2008-07-19 15:09:42 +0200 (Sat, 19 Jul 2008) | 3 lines #3323: mention that if inheriting from a class without __slots__, the subclass will have a __dict__ available too. ........ r65139 | georg.brandl | 2008-07-19 15:48:44 +0200 (Sat, 19 Jul 2008) | 2 lines Add ordering info for findall and finditer. ........ r65149 | raymond.hettinger | 2008-07-20 01:21:57 +0200 (Sun, 20 Jul 2008) | 1 line Fix compress() recipe in docs to use itertools. ........ r65150 | raymond.hettinger | 2008-07-20 01:58:47 +0200 (Sun, 20 Jul 2008) | 1 line Clean-up itertools docs and recipes. ........ r65151 | gregory.p.smith | 2008-07-20 02:22:08 +0200 (Sun, 20 Jul 2008) | 9 lines fix issue3120 - don't truncate handles on 64-bit Windows. This is still messy, realistically PC/_subprocess.c should never cast pointers to python numbers and back at all. I don't have a 64-bit windows build environment because microsoft apparently thinks that should cost money. Time to watch the buildbots. It builds and passes tests on 32-bit windows. ........ r65155 | georg.brandl | 2008-07-20 13:50:29 +0200 (Sun, 20 Jul 2008) | 2 lines #926501: add info where to put the docstring. ........ r65158 | neal.norwitz | 2008-07-20 21:35:23 +0200 (Sun, 20 Jul 2008) | 1 line Fix a couple of names in error messages that were wrong ........ r65159 | neal.norwitz | 2008-07-20 22:39:36 +0200 (Sun, 20 Jul 2008) | 1 line Fix misspeeld method name (negative) ........ r65176 | amaury.forgeotdarc | 2008-07-21 23:36:24 +0200 (Mon, 21 Jul 2008) | 4 lines Increment version number in NEWS file, and move items that were added after 2.6b2. (I thought there was a script to automate this kind of updates) ........ r65177 | amaury.forgeotdarc | 2008-07-22 00:00:38 +0200 (Tue, 22 Jul 2008) | 5 lines Issue2378: pdb would delete free variables when stepping into a class statement. The problem was introduced by r53954, the correction is to restore the symmetry between PyFrame_FastToLocals and PyFrame_LocalsToFast ........ r65178 | benjamin.peterson | 2008-07-22 00:05:34 +0200 (Tue, 22 Jul 2008) | 1 line don't use assert statement ........ r65183 | ronald.oussoren | 2008-07-22 09:06:00 +0200 (Tue, 22 Jul 2008) | 2 lines Fix buglet in fix for issue3381 ........ r65184 | ronald.oussoren | 2008-07-22 09:06:33 +0200 (Tue, 22 Jul 2008) | 2 lines Fix build issue on OSX 10.4, somehow this wasn't committed before. ........ r65187 | raymond.hettinger | 2008-07-22 20:54:02 +0200 (Tue, 22 Jul 2008) | 1 line Remove out-of-date section on Exact/Inexact. ........ r65188 | raymond.hettinger | 2008-07-22 21:00:47 +0200 (Tue, 22 Jul 2008) | 1 line Tuples now have both count() and index(). ........ r65189 | raymond.hettinger | 2008-07-22 21:03:05 +0200 (Tue, 22 Jul 2008) | 1 line Fix credits for math.sum() ........ r65190 | raymond.hettinger | 2008-07-22 21:18:50 +0200 (Tue, 22 Jul 2008) | 1 line One more attribution. ........ r65192 | benjamin.peterson | 2008-07-23 01:44:37 +0200 (Wed, 23 Jul 2008) | 1 line remove unneeded import ........ r65194 | benjamin.peterson | 2008-07-23 15:25:06 +0200 (Wed, 23 Jul 2008) | 1 line use isinstance ........ git-svn-id: http://svn.python.org/projects/python/branches/py3k@65206 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent a55c8db commit f9f945e

35 files changed

Lines changed: 309 additions & 214 deletions

Doc/glossary.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ Glossary
100100
of :class:`dict` much resembles that for :class:`list`, but the keys can
101101
be any object with a :meth:`__hash__` function, not just integers starting
102102
from zero. Called a hash in Perl.
103+
104+
docstring
105+
A docstring ("documentation string") is a string literal that appears as
106+
the first thing in a class or function suite. While ignored when the
107+
suite is executed, it is recognized by the compiler and put into the
108+
:attr:`__doc__` attribute of the class or function. Since it is available
109+
via introspection, it is the canonical place for documentation of the
110+
object.
103111

104112
duck-typing
105113
Pythonic programming style that determines an object's type by inspection

Doc/library/itertools.rst

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,11 @@ by combining :func:`map` and :func:`count` to form ``map(f, count())``.
3333
Likewise, the functional tools are designed to work well with the high-speed
3434
functions provided by the :mod:`operator` module.
3535

36-
The module author welcomes suggestions for other basic building blocks to be
37-
added to future versions of the module.
38-
3936
Whether cast in pure python form or compiled code, tools that use iterators are
40-
more memory efficient (and faster) than their list based counterparts. Adopting
37+
more memory efficient (and often faster) than their list based counterparts. Adopting
4138
the principles of just-in-time manufacturing, they create data when and where
4239
needed instead of consuming memory with the computer equivalent of "inventory".
4340

44-
The performance advantage of iterators becomes more acute as the number of
45-
elements increases -- at some point, lists grow large enough to severely impact
46-
memory cache performance and start running slowly.
47-
4841

4942
.. seealso::
5043

@@ -517,55 +510,35 @@ which incur interpreter overhead.
517510

518511
.. testcode::
519512

520-
def take(n, seq):
521-
return list(islice(seq, n))
513+
def take(n, iterable):
514+
"Return first n items of the iterable as a list"
515+
return list(islice(iterable, n))
522516

523-
def enumerate(iterable):
524-
return zip(count(), iterable)
517+
def enumerate(iterable, start=0):
518+
return zip(count(start), iterable)
525519

526-
def tabulate(function):
520+
def tabulate(function, start=0):
527521
"Return function(0), function(1), ..."
528-
return map(function, count())
529-
530-
def items(mapping):
531-
return zip(mapping.keys(), mapping.values())
522+
return map(function, count(start))
532523

533524
def nth(iterable, n):
534-
"Returns the nth item or raise StopIteration"
535-
return next(islice(iterable, n, None))
536-
537-
def all(seq, pred=None):
538-
"Returns True if pred(x) is true for every element in the iterable"
539-
for elem in filterfalse(pred, seq):
540-
return False
541-
return True
542-
543-
def any(seq, pred=None):
544-
"Returns True if pred(x) is true for at least one element in the iterable"
545-
for elem in filter(pred, seq):
546-
return True
547-
return False
548-
549-
def no(seq, pred=None):
550-
"Returns True if pred(x) is false for every element in the iterable"
551-
for elem in filter(pred, seq):
552-
return False
553-
return True
554-
555-
def quantify(seq, pred=None):
556-
"Count how many times the predicate is true in the sequence"
557-
return sum(map(pred, seq))
558-
559-
def padnone(seq):
525+
"Returns the nth item or empty list"
526+
return list(islice(iterable, n, n+1))
527+
528+
def quantify(iterable, pred=bool):
529+
"Count how many times the predicate is true"
530+
return sum(map(pred, iterable))
531+
532+
def padnone(iterable):
560533
"""Returns the sequence elements and then returns None indefinitely.
561534

562535
Useful for emulating the behavior of the built-in map() function.
563536
"""
564-
return chain(seq, repeat(None))
537+
return chain(iterable, repeat(None))
565538

566-
def ncycles(seq, n):
539+
def ncycles(iterable, n):
567540
"Returns the sequence elements n times"
568-
return chain.from_iterable(repeat(seq, n))
541+
return chain.from_iterable(repeat(iterable, n))
569542

570543
def dotproduct(vec1, vec2):
571544
return sum(map(operator.mul, vec1, vec2))
@@ -616,7 +589,21 @@ which incur interpreter overhead.
616589

617590
def compress(data, selectors):
618591
"compress('abcdef', [1,0,1,0,1,1]) --> a c e f"
619-
for d, s in zip(data, selectors):
620-
if s:
621-
yield d
622-
592+
decorated = zip(data, selectors)
593+
filtered = filter(operator.itemgetter(1), decorated)
594+
return map(operator.itemgetter(0), filtered)
595+
596+
def combinations_with_replacement(iterable, r):
597+
"combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC"
598+
pool = tuple(iterable)
599+
n = len(pool)
600+
indices = [0] * r
601+
yield tuple(pool[i] for i in indices)
602+
while True:
603+
for i in reversed(range(r)):
604+
if indices[i] != n - 1:
605+
break
606+
else:
607+
return
608+
indices[i:] = [indices[i] + 1] * (r - i)
609+
yield tuple(pool[i] for i in indices)

Doc/library/logging.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ timed intervals.
16471647
The system will save old log files by appending extensions to the filename.
16481648
The extensions are date-and-time based, using the strftime format
16491649
``%Y-%m-%d_%H-%M-%S`` or a leading portion thereof, depending on the
1650-
rollover interval.
1650+
rollover interval.
16511651
If the *utc* argument is true, times in UTC will be used; otherwise
16521652
local time is used.
16531653

@@ -2315,6 +2315,10 @@ The ``class`` entry indicates the handler's class (as determined by :func:`eval`
23152315
in the ``logging`` package's namespace). The ``level`` is interpreted as for
23162316
loggers, and ``NOTSET`` is taken to mean "log everything".
23172317

2318+
.. versionchanged:: 2.6
2319+
Added support for resolving the handler's class as a dotted module and class
2320+
name.
2321+
23182322
The ``formatter`` entry indicates the key name of the formatter for this
23192323
handler. If blank, a default formatter (``logging._defaultFormatter``) is used.
23202324
If a name is specified, it must appear in the ``[formatters]`` section and have

Doc/library/re.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,17 +571,20 @@ form.
571571
.. function:: findall(pattern, string[, flags])
572572

573573
Return all non-overlapping matches of *pattern* in *string*, as a list of
574-
strings. If one or more groups are present in the pattern, return a list of
575-
groups; this will be a list of tuples if the pattern has more than one group.
576-
Empty matches are included in the result unless they touch the beginning of
577-
another match.
574+
strings. The *string* is scanned left-to-right, and matches are returned in
575+
the order found. If one or more groups are present in the pattern, return a
576+
list of groups; this will be a list of tuples if the pattern has more than
577+
one group. Empty matches are included in the result unless they touch the
578+
beginning of another match.
578579

579580

580581
.. function:: finditer(pattern, string[, flags])
581582

582583
Return an :term:`iterator` yielding :class:`MatchObject` instances over all
583-
non-overlapping matches for the RE *pattern* in *string*. Empty matches are
584-
included in the result unless they touch the beginning of another match.
584+
non-overlapping matches for the RE *pattern* in *string*. The *string* is
585+
scanned left-to-right, and matches are returned in the order found. Empty
586+
matches are included in the result unless they touch the beginning of another
587+
match.
585588

586589

587590
.. function:: sub(pattern, repl, string[, count])

Doc/library/string.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,11 @@ zero-padding. This is equivalent to an *alignment* type of ``'='`` and a *fill*
360360
character of ``'0'``.
361361

362362
The *precision* is a decimal number indicating how many digits should be
363-
displayed after the decimal point for a floating point value. For non-number
364-
types the field indicates the maximum field size - in other words, how many
365-
characters will be used from the field content. The *precision* is ignored for
366-
integer values.
363+
displayed after the decimal point for a floating point value formatted with
364+
``'f'`` and ``'F'``, or before and after the decimal point for a floating point
365+
value formatted with ``'g'`` or ``'G'``. For non-number types the field
366+
indicates the maximum field size - in other words, how many characters will be
367+
used from the field content. The *precision* is ignored for integer values.
367368

368369
Finally, the *type* determines how the data should be presented.
369370

@@ -391,7 +392,7 @@ The available integer presentation types are:
391392
| | the current locale setting to insert the appropriate |
392393
| | number separator characters. |
393394
+---------+----------------------------------------------------------+
394-
| None | the same as ``'d'`` |
395+
| None | The same as ``'d'``. |
395396
+---------+----------------------------------------------------------+
396397

397398
The available presentation types for floating point and decimal values are:
@@ -412,10 +413,13 @@ The available presentation types for floating point and decimal values are:
412413
+---------+----------------------------------------------------------+
413414
| ``'g'`` | General format. This prints the number as a fixed-point |
414415
| | number, unless the number is too large, in which case |
415-
| | it switches to ``'e'`` exponent notation. |
416+
| | it switches to ``'e'`` exponent notation. Infinity and |
417+
| | NaN values are formatted as ``inf``, ``-inf`` and |
418+
| | ``nan``, respectively. |
416419
+---------+----------------------------------------------------------+
417420
| ``'G'`` | General format. Same as ``'g'`` except switches to |
418-
| | ``'E'`` if the number gets to large. |
421+
| | ``'E'`` if the number gets to large. The representations |
422+
| | of infinity and NaN are uppercased, too. |
419423
+---------+----------------------------------------------------------+
420424
| ``'n'`` | Number. This is the same as ``'g'``, except that it uses |
421425
| | the current locale setting to insert the appropriate |
@@ -424,7 +428,7 @@ The available presentation types for floating point and decimal values are:
424428
| ``'%'`` | Percentage. Multiplies the number by 100 and displays |
425429
| | in fixed (``'f'``) format, followed by a percent sign. |
426430
+---------+----------------------------------------------------------+
427-
| None | the same as ``'g'`` |
431+
| None | The same as ``'g'``. |
428432
+---------+----------------------------------------------------------+
429433

430434

Doc/reference/compound_stmts.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ reference to the current global namespace as the global namespace to be used
433433
when the function is called.
434434

435435
The function definition does not execute the function body; this gets executed
436-
only when the function is called.
436+
only when the function is called. [#]_
437437

438438
.. index::
439439
statement: @
@@ -535,6 +535,7 @@ Class definitions
535535
pair: name; binding
536536
pair: execution; frame
537537
single: inheritance
538+
single: docstring
538539

539540
A class definition defines a class object (see section :ref:`types`):
540541

@@ -552,10 +553,10 @@ to a class object or class type which allows subclassing. The class's suite is
552553
then executed in a new execution frame (see section :ref:`naming`), using a
553554
newly created local namespace and the original global namespace. (Usually, the
554555
suite contains only function definitions.) When the class's suite finishes
555-
execution, its execution frame is discarded but its local namespace is saved. A
556-
class object is then created using the inheritance list for the base classes and
557-
the saved local namespace for the attribute dictionary. The class name is bound
558-
to this class object in the original local namespace.
556+
execution, its execution frame is discarded but its local namespace is
557+
saved. [#]_ A class object is then created using the inheritance list for the
558+
base classes and the saved local namespace for the attribute dictionary. The
559+
class name is bound to this class object in the original local namespace.
559560

560561
Classes can also be decorated; as with functions, ::
561562

@@ -597,3 +598,11 @@ which is then bound to the class name.
597598
.. [#] Currently, control "flows off the end" except in the case of an exception or the
598599
execution of a :keyword:`return`, :keyword:`continue`, or :keyword:`break`
599600
statement.
601+
602+
.. [#] A string literal appearing as the first statement in the function body is
603+
transformed into the function's ``__doc__`` attribute and therefore the
604+
function's :term:`docstring`.
605+
606+
.. [#] A string literal appearing as the first statement in the class body is
607+
transformed into the namespace's ``__doc__`` item and therefore the class's
608+
:term:`docstring`.

Doc/reference/datamodel.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,10 @@ saved because *__dict__* is not created for each instance.
14351435
Notes on using *__slots__*
14361436
""""""""""""""""""""""""""
14371437

1438+
* When inheriting from a class without *__slots__*, the *__dict__* attribute of
1439+
that class will always be accessible, so a *__slots__* definition in the
1440+
subclass is meaningless.
1441+
14381442
* Without a *__dict__* variable, instances cannot be assigned new variables not
14391443
listed in the *__slots__* definition. Attempts to assign to an unlisted
14401444
variable name raises :exc:`AttributeError`. If dynamic assignment of new

Doc/tutorial/inputoutput.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,16 @@ attempts to use the file object will automatically fail. ::
355355
File "<stdin>", line 1, in ?
356356
ValueError: I/O operation on closed file
357357

358+
It is good practice to use the :keyword:`with` keyword when dealing with file
359+
objects. This has the advantage that the file is properly closed after its
360+
suite finishes, even if an exception is raised on the way. It is also much
361+
shorter than writing equivalent :keyword:`try`\ -\ :keyword:`finally` blocks::
362+
363+
>>> with open('/tmp/workfile', 'r') as f:
364+
... read_data = f.read()
365+
>>> f.closed
366+
True
367+
358368
File objects have some additional methods, such as :meth:`isatty` and
359369
:meth:`truncate` which are less frequently used; consult the Library Reference
360370
for a complete guide to file objects.

Doc/whatsnew/2.6.rst

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,14 +1324,6 @@ The most general ABC is :class:`Number`. It defines no operations at
13241324
all, and only exists to allow checking if an object is a number by
13251325
doing ``isinstance(obj, Number)``.
13261326

1327-
Numbers are further divided into :class:`Exact` and :class:`Inexact`.
1328-
Exact numbers can represent values precisely and operations never
1329-
round off the results or introduce tiny errors that may break the
1330-
commutativity and associativity properties; inexact numbers may
1331-
perform such rounding or introduce small errors. Integers, long
1332-
integers, and rational numbers are exact, while floating-point
1333-
and complex numbers are inexact.
1334-
13351327
:class:`Complex` is a subclass of :class:`Number`. Complex numbers
13361328
can undergo the basic operations of addition, subtraction,
13371329
multiplication, division, and exponentiation, and you can retrieve the
@@ -1449,13 +1441,15 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
14491441
it will be returned if *iterator* has been exhausted; otherwise,
14501442
the :exc:`StopIteration` exception will be raised. (:issue:`2719`)
14511443

1452-
* Tuples now have an :meth:`index` method matching the list type's
1453-
:meth:`index` method::
1444+
* Tuples now have :meth:`index` and :meth:`count` methods matching the
1445+
list type's :meth:`index` and :meth:`count` methods::
14541446

14551447
>>> t = (0,1,2,3,4)
14561448
>>> t.index(3)
14571449
3
14581450

1451+
(Contributed by Raymond Hettinger)
1452+
14591453
* The built-in types now have improved support for extended slicing syntax,
14601454
where various combinations of ``(start, stop, step)`` are supplied.
14611455
Previously, the support was partial and certain corner cases wouldn't work.
@@ -1545,7 +1539,8 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
15451539

15461540
* :func:`~math.sum` adds up the stream of numbers from an iterable,
15471541
and is careful to avoid loss of precision by calculating partial sums.
1548-
(Contributed by Jean Brouwers; :issue:`2819`.)
1542+
(Contributed by Jean Brouwers, Raymond Hettinger, and Mark Dickinson;
1543+
:issue:`2819`.)
15491544

15501545
* The inverse hyperbolic functions :func:`~math.acosh`, :func:`~math.asinh`
15511546
and :func:`~math.atanh`.
@@ -1596,8 +1591,8 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
15961591
* The string :meth:`translate` method now accepts ``None`` as the
15971592
translation table parameter, which is treated as the identity
15981593
transformation. This makes it easier to carry out operations
1599-
that only delete characters. (Contributed by Bengt Richter;
1600-
:issue:`1193128`.)
1594+
that only delete characters. (Contributed by Bengt Richter and
1595+
implemented by Raymond Hettinger; :issue:`1193128`.)
16011596

16021597
* The built-in :func:`dir` function now checks for a :meth:`__dir__`
16031598
method on the objects it receives. This method must return a list

Lib/distutils/unixccompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def _darwin_compiler_fixup(compiler_so, cc_args):
7575
if 'ARCHFLAGS' in os.environ and not stripArch:
7676
# User specified different -arch flags in the environ,
7777
# see also distutils.sysconfig
78-
compiler_so = compiler_so + ' ' + os.environ['ARCHFLAGS']
79-
78+
compiler_so = compiler_so + os.environ['ARCHFLAGS'].split()
8079

8180
if stripSysroot:
8281
try:

0 commit comments

Comments
 (0)