summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory ↵Victor Stinner2013-06-152-364/+157
| | | | | | allocators The new API require more discussion.
* Issue #3329: Add new APIs to customize memory allocatorsVictor Stinner2013-06-142-157/+364
| | | | | | | | | | | | | | | | | | | | * Add a new PyMemAllocators structure * New functions: - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory allocator functions - PyMem_GetRawAllocators(), PyMem_SetRawAllocators() - PyMem_GetAllocators(), PyMem_SetAllocators() - PyMem_SetupDebugHooks() - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators() * Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0) * Add unit test for new get/set allocators functions * PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls back on PyMem_Realloc() instead of realloc() * PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(), instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
* Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* merge 3.3 (#18183)Benjamin Peterson2013-06-101-24/+19
|\
| * remove MAX_MAXCHAR because it's unsafe for computing maximum codepoitn value ↵Benjamin Peterson2013-06-101-31/+26
| | | | | | | | (see #18183)
* | Issue #9566: Fix compiler warning on Windows 64-bitVictor Stinner2013-06-041-3/+5
| |
* | Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init()Victor Stinner2013-06-041-1/+1
| | | | | | | | | | | | The result type is int, return -1 to avoid a compiler warning (cast Py_ssize_t to int). PyObject_Size() can only fail with -1, and anyway a constructor should return -1 on error, not an arbitrary negative number.
* | Issuse #17932: Fix an integer overflow issue on Windows 64-bit in tupleVictor Stinner2013-06-041-1/+1
| | | | | | | | | | iterators: change the C type of tupleiterobject.it_index from long to Py_ssize_t.
* | Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macrosVictor Stinner2013-06-043-26/+11
| | | | | | | | multiprocessing.h: remove unused MIN and MAX macros
* | Close #17932: Fix an integer overflow issue on Windows 64-bit in iterators:Victor Stinner2013-06-041-1/+1
| | | | | | | | change the C type of seqiterobject.it_index from long to Py_ssize_t.
* | Issue #9369: The types of `char*` arguments of PyObject_CallFunction() andSerhiy Storchaka2013-05-291-7/+10
| | | | | | | | | | PyObject_CallMethod() now changed to `const char*`. Based on patches by Jörg Müller and Lars Buitinck.
* | rewrite the parsing of field names to be more consistent wrt recursive expansionBenjamin Peterson2013-05-171-62/+53
| |
* | merge 3.3Benjamin Peterson2013-05-171-2/+8
|\ \ | |/
| * only recursively expand in the format spec (closes #17644)Benjamin Peterson2013-05-171-2/+8
| |
* | mergeRaymond Hettinger2013-05-171-7/+11
|\ \ | |/
| * Issue #17563: Fix dict resize performance regression.Raymond Hettinger2013-05-171-7/+11
| |
| * when arguments are cells clear the locals slot (backport of #17927)Benjamin Peterson2013-05-151-0/+12
| |
* | Backout c89febab4648 following private feedback by Guido.Antoine Pitrou2013-05-142-266/+239
| | | | | | | | (Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
* | when an argument is a cell, set the local copy to NULL (see #17927)Benjamin Peterson2013-05-121-3/+11
| |
* | Touch up grammar for dict.update() docstring.Brett Cannon2013-05-111-4/+4
| |
* | Issue #17237: Fix crash in the ASCII decoder on m68k.Antoine Pitrou2013-05-111-0/+9
|\ \ | |/
| * Issue #17237: Fix crash in the ASCII decoder on m68k.Antoine Pitrou2013-05-111-0/+9
| |
* | #17927: Keep frame from referencing cell-ified arguments.Guido van Rossum2013-05-101-0/+4
| |
* | Issue #17807: Generators can now be finalized even when they are part of a ↵Antoine Pitrou2013-05-082-239/+266
| | | | | | | | reference cycle.
* | Use Py_intptr_t to store the difference between two pointers, instead of intVictor Stinner2013-05-071-1/+1
| | | | | | | | Fix a compiler warning on Windows 64-bit
* | Fix uninitialized value in charmap_decode_mapping()Victor Stinner2013-05-061-1/+1
| |
* | Issue #7330: Implement width and precision (ex: "%5.3s") for the format stringVictor Stinner2013-05-061-46/+109
| | | | | | | | of PyUnicode_FromFormat() function, original patch written by Ysj Ray.
* | Issue #17408: Avoid using an obsolete instance of the copyreg module when ↵Antoine Pitrou2013-05-041-5/+17
|\ \ | |/ | | | | the interpreter is shutdown and then started again.
| * Issue #17408: Avoid using an obsolete instance of the copyreg module when ↵Antoine Pitrou2013-05-041-5/+17
| | | | | | | | the interpreter is shutdown and then started again.
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly.
* | Closes #17892: Fix the name of _PyObject_CallMethodObjIdArgsAlexandre Vassalotti2013-05-021-1/+1
| |
* | Merge removal of trailing whitespace from 3.3.Ezio Melotti2013-04-211-7/+7
|\ \ | |/
| * Remove trailing whitespace.Ezio Melotti2013-04-211-7/+7
| |
* | Partial revert of changeset 9744b2df134cVictor Stinner2013-04-181-5/+4
| | | | | | | | | | PyUnicode_Append() cannot call directly resize_compact(): I forgot that a string can be ready *and* not compact (a legacy string can also be ready).
* | Split PyUnicode_DecodeCharmap() into subfunction for readabilityVictor Stinner2013-04-171-178/+213
| |
* | Fix bug in Unicode decoders related to _PyUnicodeWriterVictor Stinner2013-04-171-6/+14
| | | | | | | | Bug introduced by changesets 7ed9993d53b4 and edf029fc9591.
* | Fix typo in unicode_decode_call_errorhandler_writer()Victor Stinner2013-04-171-1/+1
| | | | | | | | Bug introduced by changeset 7ed9993d53b4.
* | Close #17694: Add minimum length to _PyUnicodeWriterVictor Stinner2013-04-175-60/+63
| | | | | | | | | | | | | | | | | | | | | | | | * Add also min_char attribute to _PyUnicodeWriter structure (currently unused) * _PyUnicodeWriter_Init() has no more argument (except the writer itself): min_length and overallocate must be set explicitly * In error handlers, only enable overallocation if the replacement string is longer than 1 character * CJK decoders don't use overallocation anymore * Set min_length, instead of preallocating memory using _PyUnicodeWriter_Prepare(), in many decoders * _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
* | Cleanup PyUnicode_Contains()Victor Stinner2013-04-141-11/+6
| | | | | | | | | | | | * No need to double-check that strings are ready: test already done by PyUnicode_FromObject() * Remove useless kind variable (use kind1 instead)
* | Minor change: fix character in do_strip() for the ASCII caseVictor Stinner2013-04-141-2/+2
| |
* | Cleanup PyUnicode_Append()Victor Stinner2013-04-141-18/+14
| | | | | | | | | | | | | | * Check also that right is a Unicode object * call directly resize_compact() instead of unicode_resize() for a more explicit error handling, and to avoid testing some properties twice (ex: unicode_modifiable())
* | PyUnicode_Join(): move use_memcpy test out of the loop to cleanup and ↵Victor Stinner2013-04-141-20/+28
| | | | | | | | optimize the code
* | Optimize repr(str): use _PyUnicode_FastCopyCharacters() when no character is ↵Victor Stinner2013-04-141-69/+78
| | | | | | | | escaped
* | Optimize ascii(str): don't encode/decode repr if repr is already ASCIIVictor Stinner2013-04-142-1/+4
| |
* | stringlib: remove unused STRINGLIB_RESIZE macroVictor Stinner2013-04-147-7/+0
| |
* | Add _PyUnicodeWriter_WriteCharInline()Victor Stinner2013-04-141-71/+35
| |
* | Issue #16061: Speed up str.replace() for replacing 1-character strings.Serhiy Storchaka2013-04-132-26/+91
| |
* | Issue #17715: Merge fix from 3.3.Mark Dickinson2013-04-131-0/+2
|\ \ | |/
| * Issue #17715: Add missing NULL Check to PyNumber_Long.Mark Dickinson2013-04-131-0/+2
| |
* | Issue #17643: Add __callback__ attribute to weakref.ref.Mark Dickinson2013-04-131-1/+6
| |