summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic inWalter Dörwald2009-04-251-2/+2
| | | | | makeunicodedata.py and regenerated the Unicode database (This fixes u'\u1d79'.lower() == '\x00').
* Fix typo in complex parsing code; expand tests.Mark Dickinson2009-04-251-1/+1
|
* fix a segfault when setting __class__ in __del__ #5283Benjamin Peterson2009-04-251-0/+6
|
* Fix missing 'return NULL'Mark Dickinson2009-04-241-1/+1
|
* Issue #5816:Mark Dickinson2009-04-241-164/+158
| | | | | | | | - 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')
* Fixed issue 5782: formatting with commas didn't work if no specifier type ↵Eric Smith2009-04-221-0/+1
| | | | code was given.
* Backport of some of the work in r71665 to trunk. This reworks much ofEric Smith2009-04-223-443/+676
| | | | | | | | | | | | | | | | | | | | | 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.
* Issue #3166: Make long -> float (and int -> float) conversionsMark Dickinson2009-04-202-27/+220
| | | | | | 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.
* make errors consistentBenjamin Peterson2009-04-191-2/+2
|
* initialize weakref some weakref typesBenjamin Peterson2009-04-191-0/+6
|
* many more types to initialize (I had to expose some of them)Benjamin Peterson2009-04-183-6/+48
|
* initalize -> initializeBenjamin Peterson2009-04-181-4/+4
|
* try to initalize all builtin types with PyType_Ready to avoid problems like ↵Benjamin Peterson2009-04-182-16/+68
| | | | #5787
* rename internal bytes_ functions to bytearrayBenjamin Peterson2009-04-181-153/+153
|
* "not subscriptable" should be a bit more understandable than "unsubscriptable".Georg Brandl2009-04-181-1/+1
|
* call __float__ on str subclasses #5759Benjamin Peterson2009-04-151-1/+3
| | | | tests by R. David Murray
* Fixed incorrect object passed into format_float_internal(). This was ↵Eric Smith2009-04-131-1/+1
| | | | resulting in a conversion being done twice.
* Whitespace normalization.Georg Brandl2009-04-051-8/+8
|
* #5615: make it possible to configure --without-threads again.Georg Brandl2009-04-051-0/+6
|
* Issue #2396: backport the memoryview object.Antoine Pitrou2009-04-023-4/+842
|
* sys.long_info attributes should be ints, not longsMark Dickinson2009-04-021-2/+4
|
* Fix a wrong struct field assignment (docstring as closure).Georg Brandl2009-03-311-1/+1
|
* Issue #532631: Apply floatformat changes to unicodeobject.cMark Dickinson2009-03-291-0/+9
| | | | as well as stringobject.c.
* Issue #532631: Add paranoid check to avoid potential buffer overflowMark Dickinson2009-03-291-1/+10
| | | | on systems with sizeof(int) > 4.
* Issue #532631: Replace confusing fabs(x)/1e25 >= 1e25 testMark Dickinson2009-03-293-3/+3
| | | | with fabs(x) >= 1e50, and fix documentation.
* The tracking statistics were actually too pessimisticAntoine Pitrou2009-03-232-3/+4
|
* Issue #4688: Add a heuristic so that tuples and dicts containing onlyAntoine Pitrou2009-03-232-1/+135
| | | | | | | | | untrackable objects are not tracked by the garbage collector. This can reduce the size of collections and therefore the garbage collection overhead on long-running programs, depending on their particular use of datatypes. (trivia: this makes the "binary_trees" benchmark from the Computer Language Shootout 40% faster)
* Issue #5512: speed up the long division algorithm for Python longs.Mark Dickinson2009-03-231-94/+152
| | | | | | | | | | | | | | | The basic algorithm remains the same; the most significant speedups come from the following three changes: (1) normalize by shifting instead of multiplying and dividing (2) the old algorithm usually did an unnecessary extra iteration of the outer loop; remove this. As a special case, this means that long divisions with a single-digit result run twice as fast as before. (3) make inner loop much tighter. Various benchmarks show speedups of between 50% and 150% for long integer divisions and modulo operations.
* There is no macro named SIZEOF_SSIZE_T. Should use SIZEOF_SIZE_T instead.Hirokazu Yamamoto2009-03-211-1/+1
|
* Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.Mark Dickinson2009-03-201-0/+49
| | | | Backport of r70459.
* fix strange errors when setting attributes on tracebacks #4034Benjamin Peterson2009-03-181-1/+11
|
* Issue 4474: On platforms with sizeof(wchar_t) == 4 andMark Dickinson2009-03-181-0/+58
| | | | | | | | | sizeof(Py_UNICODE) == 2, PyUnicode_FromWideChar now converts each character outside the BMP to the appropriate surrogate pair. Thanks Victor Stinner for the patch. (backport of r70452 from py3k to trunk)
* Fix a small nit in the error message if bool() falls back on __len__ and it ↵Georg Brandl2009-03-151-1/+5
| | | | returns the wrong type: it would tell the user that __nonzero__ should return bool or int.
* fix tuple.index() error message #5495Benjamin Peterson2009-03-151-1/+1
|
* Issue 5237, Allow auto-numbered replacement fields in str.format() strings.Eric Smith2009-03-141-44/+129
| | | | | | | | | | | | | | | | | For simple uses for str.format(), this makes the typing easier. Hopfully this will help in the adoption of str.format(). For example: 'The {} is {}'.format('sky', 'blue') You can mix and matcth auto-numbering and named replacement fields: 'The {} is {color}'.format('sky', color='blue') But you can't mix and match auto-numbering and specified numbering: 'The {0} is {}'.format('sky', 'blue') ValueError: cannot switch from manual field specification to automatic field numbering Will port to 3.1.
* fix funky indentationBenjamin Peterson2009-03-081-4/+4
|
* Fixed memory leak on failure.Hirokazu Yamamoto2009-03-051-1/+1
|
* Replace long with twodigits, to avoid dependingMark Dickinson2009-02-251-1/+1
| | | | on sizeof(digit) < sizeof(long)
* Issue #5341: Fix a variety of spelling errors.Mark Dickinson2009-02-214-4/+4
|
* Issue #5247: Improve error message when unknown format codes are used when ↵Eric Smith2009-02-201-17/+31
| | | | using str.format() with str, unicode, long, int, and float arguments.
* A few more minor fixes in longobject.cMark Dickinson2009-02-151-5/+4
|
* Issue #5260: Various portability and standards compliance fixes, optimizationsMark Dickinson2009-02-151-46/+35
| | | | | | | and cleanups in Objects/longobject.c. The most significant change is that longs now use less memory: average savings are 2 bytes per long on 32-bit systems and 6 bytes per long on 64-bit systems. (This memory saving already exists in py3k.)
* Fix compiler warning (gcc)Antoine Pitrou2009-02-131-1/+1
|
* Issue #5186: Reduce hash collisions for objects with no __hash__ method byAntoine Pitrou2009-02-131-15/+7
| | | | rotating the object pointer by 4 bits to the right.
* Fix warnings GCC emits where the argument of PyErr_Format is a single variable.Georg Brandl2009-02-131-3/+3
|
* Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError forMark Dickinson2009-02-101-1/+1
| | | | | | negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin.
* Issue 4804. Add a function to test the validity of file descriptors on ↵Kristján Valur Jónsson2009-02-101-34/+0
| | | | Windows, and stop using global runtime settings to silence the warnings / assertions.
* Issue #789290: make sure that hash(2**63) == hash(2.**63) on 64-bitMark Dickinson2009-02-081-1/+1
| | | | | | | | | | | platforms. The previous code was fragile, depending on the twin accidents that: (1) in C, casting the double value 2.**63 to long returns the integer value -2**63, and (2) in Python, hash(-2**63) == hash(2**63). There's already a test for this in test_hash.
* Remove redundant assignment in _PyObject_LengthHintMark Dickinson2009-02-081-1/+1
|
* issue 4804: Provide checks for the format string of strftime, and for the ↵Kristján Valur Jónsson2009-02-041-1/+88
| | | | "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid.