Commit Graph

12656 Commits

Author SHA1 Message Date
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
Mark Dickinson 3a94ee05f7 Typos in decimal comment and documentation 2008-02-10 15:19:58 +00:00
Mark Dickinson 74d0914413 Turn classmethods into staticmethods, and avoid calling the constructor
of subclasses of Rational.  (See discussion in issue #1682.)
2008-02-10 14:58:38 +00:00
Nick Coghlan 97fac3eb0a Issue 2021: Allow NamedTemporaryFile and SpooledTemporaryFile to be used as context managers. (The NamedTemporaryFile fix should be considered for backporting to 2.5) 2008-02-09 15:28:09 +00:00
Raymond Hettinger 8c6c12ca96 Temporarily disable this test. It's been broken for a week. 2008-02-09 10:06:20 +00:00
Raymond Hettinger 2cd9bf5e7c Metaclass declaration is inherited 2008-02-09 10:04:19 +00:00
Raymond Hettinger 2e827bfdfe Merge with r60683. 2008-02-09 03:34:52 +00:00
Raymond Hettinger c2bc0d17e8 Make ABC containers inherit as documented. 2008-02-09 01:18:42 +00:00
Raymond Hettinger d53f1c4d41 Fill-in missing Set comparisons 2008-02-08 23:34:21 +00:00
Raymond Hettinger 18a1ffcda3 Speed-up __iter__() mixin method. 2008-02-08 23:02:27 +00:00
Hye-Shik Chang 01612e7dec Update big5hkscs codec to conform to the HKSCS:2004 revision. 2008-02-08 17:10:20 +00:00
Jeffrey Yasskin 27d339446a Oops! 2.6's Rational.__ne__ didn't work. 2008-02-08 06:45:40 +00:00
Amaury Forgeot d'Arc b01aa430d5 issue 2045: Infinite recursion when printing a subclass of defaultdict,
if default_factory is set to a bound method.

Will backport.
2008-02-08 00:56:02 +00:00
Walter Dörwald d0e5b766f1 Fix typo in docstring for Calendar.itermonthdays(). 2008-02-07 19:57:32 +00:00
Facundo Batista 86371d61b7 Fixes Issue 1401. When redirected, a possible POST get converted
to GET, so it loses its payload. So, it also must lose the
headers related to the payload (if it has no content any more,
it shouldn't indicate content length and type).
2008-02-07 19:06:52 +00:00
Facundo Batista 9521f08b98 Fixes issue 2026. Tests converted to unittest. Thanks
Giampaolo Rodola.
2008-02-07 16:16:29 +00:00
Andrew M. Kuchling 8d119301a1 Update URL 2008-02-07 11:43:47 +00:00
Raymond Hettinger 882a416900 Merge r60628, r60631, and r60633. Register UserList and UserString will the appropriate ABCs. 2008-02-07 03:25:46 +00:00
Raymond Hettinger 017b6a3ad2 Merge 60627. 2008-02-07 03:10:33 +00:00
Raymond Hettinger 5b07ebce86 Issue 2025: Add tuple.count() and tuple.index() to follow the ABC in collections.Sequence. 2008-02-07 00:54:20 +00:00
Georg Brandl 3c3d9ac46c Revert accidental changes to test_queue in r60605. 2008-02-06 23:45:51 +00:00
Mark Dickinson 2fc9263df5 Issue 1979: Make Decimal comparisons (other than !=, ==) involving NaN
raise InvalidOperation (and return False if InvalidOperation is trapped).
2008-02-06 22:10:50 +00:00