Commit Graph

3110 Commits

Author SHA1 Message Date
Mark Dickinson
df108ca324 Remove format_float and use _PyOS_double_to_string instead. 2009-04-29 21:56:53 +00:00
Eric Smith
cac7af6863 Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to py3k. Should fix Windows buildbot errors. 2009-04-27 19:04:37 +00:00
Mark Dickinson
6d6b220215 Backport r71967 changes from py3k to trunk.
(Internal plumbing changes for float parsing.)
2009-04-26 16:04:05 +00:00
Mark Dickinson
944c6aedd0 Reset errno before both calls to PyOS_ascii_strtod, not just one. 2009-04-26 14:00:08 +00:00
Martin v. Löwis
99f277933e Issue #4971: Fix titlecase for characters that are their own
titlecase, but not their own uppercase.
2009-04-26 00:53:18 +00:00
Eric Smith
068f06568b Issue #5835, deprecate PyOS_ascii_formatd.
If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great.

Will port to py3k with a different strategy.
2009-04-25 21:40:15 +00:00
Walter Dörwald
5d98ec76bb Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
makeunicodedata.py and regenerated the Unicode database (This fixes
u'\u1d79'.lower() == '\x00').
2009-04-25 14:03:16 +00:00
Mark Dickinson
0a6501bf56 Fix typo in complex parsing code; expand tests. 2009-04-25 09:47:00 +00:00
Benjamin Peterson
5083dc552b fix a segfault when setting __class__ in __del__ #5283 2009-04-25 00:41:22 +00:00
Mark Dickinson
90d47cb46c Fix missing 'return NULL' 2009-04-24 13:14:07 +00:00
Mark Dickinson
95bc980d9e Issue #5816:
- simplify parsing and printing of complex numbers
 - make complex(repr(z)) round-tripping work for complex
   numbers involving nans, infs, or negative zeros
 - don't accept some of the stranger complex strings
   that were previously allowed---e.g., complex('1..1j')
2009-04-24 12:46:53 +00:00
Eric Smith
ebafbb705c Fixed issue 5782: formatting with commas didn't work if no specifier type code was given. 2009-04-22 16:20:47 +00:00
Eric Smith
aca19e6a74 Backport of some of the work in r71665 to trunk. This reworks much of
int, long, and float __format__(), and it keeps their implementation
in sync with py3k.

Also added PyOS_double_to_string. This is the "fallback" version
that's also available in trunk, and should be kept in sync with that
code. I'll add an issue to document PyOS_double_to_string in the C
API.

There are many internal cleanups. Externally visible changes include:

- Implement PEP 378, Format Specifier for Thousands Separator, for
  floats, ints, and longs.

- Issue #5515: 'n' formatting for ints, longs, and floats handles
  leading zero formatting poorly.

- Issue #5772: For float.__format__, don't add a trailing ".0" if
  we're using no type code and we have an exponent.
2009-04-22 13:29:05 +00:00
Mark Dickinson
6736cf8d20 Issue #3166: Make long -> float (and int -> float) conversions
correctly rounded, using round-half-to-even.  This ensures that the
value of float(n) doesn't depend on whether we're using 15-bit digits
or 30-bit digits for Python longs.
2009-04-20 21:13:33 +00:00
Benjamin Peterson
8cfa8e613f make errors consistent 2009-04-19 02:40:43 +00:00
Benjamin Peterson
308c6ba002 initialize weakref some weakref types 2009-04-19 02:32:42 +00:00
Benjamin Peterson
01c6e6fb35 many more types to initialize (I had to expose some of them) 2009-04-18 22:15:26 +00:00
Benjamin Peterson
5ce73759bf initalize -> initialize 2009-04-18 20:25:25 +00:00
Benjamin Peterson
d4d400cb8a try to initalize all builtin types with PyType_Ready to avoid problems like #5787 2009-04-18 20:12:47 +00:00
Benjamin Peterson
d672001b03 rename internal bytes_ functions to bytearray 2009-04-18 15:31:34 +00:00
Georg Brandl
f5fd523981 "not subscriptable" should be a bit more understandable than "unsubscriptable". 2009-04-18 08:26:21 +00:00
Benjamin Peterson
99d36f1563 call __float__ on str subclasses #5759
tests by R. David Murray
2009-04-15 21:26:36 +00:00
Eric Smith
8c023248ed Fixed incorrect object passed into format_float_internal(). This was resulting in a conversion being done twice. 2009-04-13 00:29:50 +00:00
Georg Brandl
517cfdcfd9 Whitespace normalization. 2009-04-05 13:16:35 +00:00
Georg Brandl
d3eaa745a9 #5615: make it possible to configure --without-threads again. 2009-04-05 11:07:14 +00:00