Raymond Hettinger
31ce5cb989
Update more instances of has_key().
2008-02-21 19:24:53 +00:00
Thomas Heller
8982cf5484
Replace 'has_key()' with 'in'.
...
Replace 'raise Error, stuff' with 'raise Error(stuff)'.
2008-02-21 18:52:20 +00:00
Guido van Rossum
8bc0965adf
Removed uses of dict.has_key() from distutils, and uses of
...
callable() from copy_reg.py, so the interpreter now starts up
without warnings when '-3' is given. More work like this needs to
be done in the rest of the stdlib.
2008-02-21 18:18:37 +00:00
Andrew M. Kuchling
2d6c13e733
Close manifest file.
...
This change doesn't make any difference to CPython, but is a necessary fix for Jython.
2008-02-21 14:23:38 +00:00
Eric Smith
7ef40bf9c7
Trim leading zeros from a floating point exponent, per C99. See issue 1600. As far as I know, this only affects Windows. Add float type 'n' to PyOS_ascii_formatd (see PEP 3101 for 'n' description).
2008-02-20 23:34:22 +00:00
Eric Smith
bc32fee029
Added code to correct combining str and unicode in ''.format(). Added test case.
2008-02-18 18:02:34 +00:00
Eric Smith
d50a5f2845
Temporarily removed float tests. See issue 1600.
2008-02-18 14:25:02 +00:00
Facundo Batista
d14600ec94
Issue 1224. Now we support again the double slash in the URL.
...
Thanks Anthony Lenton.
2008-02-18 12:48:43 +00:00
Facundo Batista
759bfc6207
Issue #1916 . Added isgenerator() and isgeneratorfunction() to
...
inspect.py. Thanks Javi Mansilla for patch review and
corrections.
2008-02-18 03:43:43 +00:00
Georg Brandl
b169eaa917
#2133 : fix HTML color spec.
2008-02-17 21:18:55 +00:00
Eric Smith
a9f7d62480
Backport of PEP 3101, Advanced String Formatting, from py3k.
...
Highlights:
- Adding PyObject_Format.
- Adding string.Format class.
- Adding __format__ for str, unicode, int, long, float, datetime.
- Adding builtin format.
- Adding ''.format and u''.format.
- str/unicode fixups for formatters.
The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
2008-02-17 19:46:49 +00:00
Facundo Batista
e139688d34
Issue 2112. mmap does not raises EnvironmentError no more, but
...
a subclass of it. Thanks John Lenton.
2008-02-17 18:59:29 +00:00
Brett Cannon
f9db8a3a20
Move test_logging over to doctest.
...
Thanks to Christopher White from GHOP.
2008-02-17 01:59:18 +00:00
Amaury Forgeot d'Arc
632fad3933
Prevent a crash with nested scopes, again caused by calling Py_DECREF when the pointer
...
is still present in the containing structure.
2008-02-16 20:55:24 +00:00
Raymond Hettinger
71fa93af22
Add __all__ to logging module.
2008-02-16 01:22:54 +00:00
Amaury Forgeot d'Arc
64d6843788
mmap.PROT_READ does not exists on win32;
...
Skip this test created by r60830.
2008-02-16 00:16:50 +00:00
Amaury Forgeot d'Arc
d8bcbf2b2e
Re-enable tests, they were failing since gc.collect() clears the various freelists.
...
They still remain fragile.
For example, a call to assertEqual currently does not make any allocation
(which surprised me at first).
But this can change when gc.collect also deletes the numerous "zombie frames"
attached to each function.
2008-02-15 22:44:20 +00:00
Kurt B. Kaiser
f05fa33a6c
Configured selection highlighting colors were ignored; updating highlighting
...
in the config dialog would cause non-Python files to be colored as if they
were Python source; improve use of ColorDelagator. Patch 1334. Tal Einat.
2008-02-15 22:25:09 +00:00
Kurt B. Kaiser
e312cfddd3
ScriptBinding event handlers weren't returning 'break'. Patch 2050, Tal Einat.
2008-02-15 21:56:36 +00:00
Amaury Forgeot d'Arc
f67abccf64
Temporarily let these tests pass
2008-02-15 21:27:44 +00:00
Amaury Forgeot d'Arc
60d6c7f0cc
Issue #2115 : __slot__ attributes setting was 10x slower.
...
Also correct a possible crash using ABCs.
This change is exactly the same as an optimisation
done 5 years ago, but on slot *access*:
http://svn.python.org/view?view=rev&rev=28297
2008-02-15 21:22:45 +00:00
Christian Heimes
7adfad850a
Bug #2111 : mmap segfaults when trying to write a block opened with PROT_READ
...
Thanks to Thomas Herve for the fix.
2008-02-15 08:20:11 +00:00
Christian Heimes
2f0da53d28
Fixed repr() and str() of complex numbers. Complex suffered from the same problem as floats but I forgot to test and fix them.
2008-02-15 06:57:08 +00:00
Raymond Hettinger
36316e37d5
No need to register subclass of ABCs.
2008-02-14 19:30:30 +00:00
Raymond Hettinger
1b5632445b
Add diagnostic message to help figure-out why SocketServer tests occasionally crash
...
when trying to remove a pid that in not in the activechildren list.
2008-02-14 09:32:45 +00:00
Jeffrey Yasskin
339f5e3ffc
Change simple instances (in Fraction) of self.numerator and self.denominator to
...
self._numerator and self._denominator. This speeds abs() up from 12.2us to
10.8us and trunc() from 2.07us to 1.11us. This doesn't change _add and friends
because they're more complicated.
2008-02-14 07:49:25 +00:00
Jeffrey Yasskin
1c214d6c94
Performance optimizations on Fraction's constructor.
...
./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3)`
31.7 usec/loop -> 9.2 usec/loop
./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3, 2)'`
27.7 usec/loop -> 9.32 usec/loop
./python.exe -m timeit -s 'from fractions import Fraction; f = Fraction(3, 2)' 'Fraction(f)'
31.9 usec/loop -> 14.3 usec/loop
2008-02-14 06:12:24 +00:00
Raymond Hettinger
abe3237187
Fix decimal repr which should have used single quotes like other reprs.
2008-02-14 02:41:22 +00:00
Raymond Hettinger
ddb164a651
Update notes on Decimal.
2008-02-14 01:08:02 +00:00
Kurt B. Kaiser
ac45aff2f1
Bring NEWS.txt up to date from check-in msgs.
2008-02-14 00:08:55 +00:00
Thomas Heller
4516451aec
Make the test somewhat clearer (I hope).
2008-02-13 20:36:51 +00:00
Thomas Heller
a06a1a88ee
Add pickle support to ctypes types.
2008-02-13 20:21:53 +00:00
Jeffrey Yasskin
57bd60b465
Working on issue #1762 : Brought
...
./python.exe -m timeit -s 'from fractions import Fraction; f = Fraction(3, 2)' 'isinstance(3, Fraction); isinstance(f, Fraction)'
from 12.3 usec/loop to 3.44 usec/loop and
./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3, 2)'
from 48.8 usec to 23.6 usec by avoiding genexps and sets in __instancecheck__
and inlining the common case from __subclasscheck__.
2008-02-13 17:58:04 +00:00
Mark Dickinson
5f8bd3729e
Replace R=fractions.Fraction with F=fractions.Fraction in
...
test_fractions.py. This should have been part of the name
change from Rational to Fraction.
2008-02-12 21:46:54 +00:00
Mark Dickinson
0aa52a1658
Revert change in r60712: turn alternate constructors back into
...
classmethods instead of staticmethods.
2008-02-12 21:40:53 +00:00
Mark Dickinson
e1b824793a
Implementation of Fraction.limit_denominator.
...
Remove Fraction.to_continued_fraction and
Fraction.from_continued_fraction
2008-02-12 21:31:59 +00:00
Martin v. Löwis
dad88dc159
Patch #1966 : Break infinite loop in httplib when the servers
...
implements the chunked encoding incorrectly.
Will backport to 2.5.
2008-02-12 18:47:34 +00:00
Kurt B. Kaiser
8d365c323f
what??! Correct r60225.
2008-02-12 15:45:50 +00:00
Raymond Hettinger
116f72fa5c
Bring decimal a bit closer to the spec for Reals.
2008-02-12 01:18:03 +00:00
Raymond Hettinger
19a5c29d27
Fix typo in comments
2008-02-12 00:48:20 +00:00
Raymond Hettinger
48688d8c8e
Add notes on how decimal fits into the model.
2008-02-11 22:53:01 +00:00
Raymond Hettinger
21290eacf6
Add tests for pickletools.optimize().
2008-02-11 20:05:53 +00:00
Lars Gustäbel
6bf51da9d4
Make sure that xstar headers are read correctly.
2008-02-11 19:17:10 +00:00
Raymond Hettinger
31f6bc018b
No need to register classes that already inherit from ABCs.
2008-02-11 18:51:08 +00:00
Mark Dickinson
cd873fc142
Put an extra space into the repr of a Fraction:
...
Fraction(1, 2) instead of Fraction(1,2).
2008-02-11 03:11:55 +00:00
Christian Heimes
03d3abf375
The test requires the network resource
2008-02-11 02:26:22 +00:00
Mark Dickinson
d058cd2cc8
Rename rational.Rational to fractions.Fraction, to avoid name clash
...
with numbers.Rational. See issue #1682 for related discussion.
2008-02-10 21:29:51 +00:00
Raymond Hettinger
da614dcc4f
Complete an open todo on pickletools -- add a pickle optimizer.
2008-02-10 20:35:16 +00:00
Skip Montanaro
a5a9a733c8
whoops - revert
2008-02-10 15:32:16 +00:00
Skip Montanaro
c376f20d76
Get the saying right. ;-)
2008-02-10 15:31:54 +00:00