Commit graph

5038 commits

Author SHA1 Message Date
Victor Stinner
29dacf2e97 Issue #15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and
PyUnicode_EncodeCodePage() now raise an exception if the object is not an
Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case on
platforms other than Windows. Patch written by Campbell Barton.
2015-01-26 16:41:32 +01:00
Benjamin Peterson
a8efc9601d ensure ilen is initialized when it is assigned to len 2015-01-26 09:23:41 -05:00
Serhiy Storchaka
34af5023fc Issue #21408: The default __ne__() now returns NotImplemented if __eq__()
returned NotImplemented.  Removed incorrect implementations of __ne__().
2015-01-26 10:04:15 +02:00
Serhiy Storchaka
f4b7a02e93 Issue #21408: The default __ne__() now returns NotImplemented if __eq__()
returned NotImplemented.  Removed incorrect implementations of __ne__().
2015-01-26 09:57:07 +02:00
Raymond Hettinger
b335dfe7fa Set the hash values of dummy entries to -1. Improves quality of entry->hash == hash tests. 2015-01-25 16:38:52 -08:00
Raymond Hettinger
4d45c1069b Update out-of-date comments. 2015-01-25 16:27:40 -08:00
Raymond Hettinger
93035c44fd Issue #23119: Simplify setobject by inlining the special case for unicode equality testing. 2015-01-25 16:12:49 -08:00
Serhiy Storchaka
bbd3aa8ece Issue #23321: Fixed a crash in str.decode() when error handler returned
replacment string longer than mailformed input data.
2015-01-26 01:24:31 +02:00
Serhiy Storchaka
7e4b9057b3 Issue #23321: Fixed a crash in str.decode() when error handler returned
replacment string longer than mailformed input data.
2015-01-26 01:22:54 +02:00
Ethan Furman
b95b56150f Issue20284: Implement PEP461 2015-01-23 20:05:18 -08:00
Raymond Hettinger
ed741d4ff0 A hybrid of and-masking and a conditional-set-to-zero produce even faster search loop. 2015-01-18 21:25:15 -08:00
Raymond Hettinger
bd9b200b87 Update copyright for 2015 updates. 2015-01-18 16:10:30 -08:00
Raymond Hettinger
9cd6a789c6 Clean-up, simplify, and slightly speed-up bounds logic in set_pop().
Elsewhere in the setobject.c code we do a bitwise-and with the mask
instead of using a conditional to reset to zero on wrap-around.
Using that same technique here use gives cleaner, faster, and more
consistent code.
2015-01-18 16:06:18 -08:00
Raymond Hettinger
1202a4733e Issue 23261: Clean-up the hack to store the set.pop() search finger in a hash field instead of the setobject. 2015-01-18 13:12:42 -08:00
Serhiy Storchaka
82e07b92b3 Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:33:31 +02:00
Serhiy Storchaka
d3faf43f9b Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
Benjamin Peterson
645f896536 merge 3.4 (#23210) 2015-01-09 16:40:38 -06:00
Benjamin Peterson
bcf8554fd4 remove buzzword (closes #23210) 2015-01-09 16:40:23 -06:00
Raymond Hettinger
8edf27c134 Small clean-up. Factor-out common code for add, contains, and discard function pairs. 2014-12-26 23:08:58 -08:00
Raymond Hettinger
08e3dc0ad6 Issue #23107: Tighten-up loops in setobject.c
* Move the test for an exact key match to after a hash match
* Use "used" as a loop counter instead of "fill"
* Minor improvements to variable names and code consistency
2014-12-26 20:14:00 -08:00
Serhiy Storchaka
707b5ccde5 Issue #22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
opcode if possible.
2014-12-16 19:43:46 +02:00
Serhiy Storchaka
b757c83ec6 Issue #22581: Use more "bytes-like object" throughout the docs and comments. 2014-12-05 22:25:22 +02:00
Serhiy Storchaka
83cf99d733 Issue #20335: bytes constructor now raises TypeError when encoding or errors
is specified with non-string argument.  Based on patch by Renaud Blanch.
2014-12-02 09:24:06 +02:00
Serhiy Storchaka
133b11b566 Issue #22975: Close block at right place. 2014-12-01 18:56:28 +02:00
Benjamin Peterson
e823933f9f remove tautological condition (closes #22954) 2014-11-26 23:03:11 -06:00
Serhiy Storchaka
92bf919ed0 Issue #22581: Use more "bytes-like object" throughout the docs and comments. 2014-12-05 22:26:10 +02:00
Serhiy Storchaka
0b2cacb42a Issue #20335: bytes constructor now raises TypeError when encoding or errors
is specified with non-string argument.  Based on patch by Renaud Blanch.
2014-12-02 09:26:14 +02:00
Serhiy Storchaka
407249c62b Issue #22975: Close block at right place. 2014-12-01 18:56:54 +02:00
Benjamin Peterson
0a59d5563e merge 3.4 (#22954) 2014-11-26 23:03:34 -06:00
Nick Coghlan
d600951748 Issue #22869: Split pythonrun into two modules
- interpreter startup and shutdown code moved to a new
  pylifecycle.c module
- Py_OptimizeFlag moved into the new module with the other
  global flags
2014-11-20 21:39:37 +10:00
Victor Stinner
3aa979e0cd Issue #20948: Inline makefmt() in unicode_fromformat_arg() 2014-11-18 21:40:51 +01:00
Antoine Pitrou
2a40e36739 Issue #22847: Improve method cache efficiency. 2014-11-15 00:56:27 +01:00
Antoine Pitrou
8a03896cac Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff bytes on a 32-bit platform. 2014-11-02 18:41:56 +01:00
Antoine Pitrou
cc23154d02 Issue #22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff bytes on a 32-bit platform. 2014-11-02 18:40:09 +01:00
Georg Brandl
b8fa289152 merge with 3.4 2014-10-31 13:13:09 +01:00
Georg Brandl
e1d26f377e Closes #22772: fix __ifloordiv__ and __itruediv__ docstring. 2014-10-31 13:12:57 +01:00
Antoine Pitrou
bc92bbd4d2 Issue #22653: Fix an assertion failure in debug mode when doing a reentrant dict insertion in debug mode. 2014-10-18 00:35:44 +02:00
Antoine Pitrou
d696732025 Issue #22653: Fix an assertion failure in debug mode when doing a reentrant dict insertion in debug mode. 2014-10-18 00:35:00 +02:00
Benjamin Peterson
fa5021699a Merge 3.3 2014-10-15 23:58:32 -04:00
Antoine Pitrou
b6dc9b7554 Fixed signed/unsigned comparison warning 2014-10-15 23:14:53 +02:00
Antoine Pitrou
4e334241b7 Fixed signed/unsigned comparison warning 2014-10-15 23:14:53 +02:00
Benjamin Peterson
736982d36d merge 3.4 (closes #22643) 2014-10-15 12:17:47 -04:00
Benjamin Peterson
9c422f3c3d merge 3.3 2014-10-15 12:17:33 -04:00
Benjamin Peterson
1e211ff10d it suffices to check for PY_SSIZE_T_MAX overflow (#22643) 2014-10-15 12:17:21 -04:00
Benjamin Peterson
315aa40403 Merge 3.4 2014-10-15 11:51:17 -04:00
Benjamin Peterson
60d7a73194 Merge 3.3 2014-10-15 11:51:12 -04:00
Benjamin Peterson
c0e64f5027 make sure length is unsigned 2014-10-15 11:51:05 -04:00
Benjamin Peterson
6925264334 merge 3.4 (#22643) 2014-10-15 11:49:15 -04:00
Benjamin Peterson
1cbb3fe775 merge 3.3 (#22643) 2014-10-15 11:48:41 -04:00
Benjamin Peterson
e1bd38c03c fix integer overflow in unicode case operations (closes #22643) 2014-10-15 11:47:36 -04:00