summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Issue #26304: Merge doc wording from 3.5Martin Panter2016-02-101-1/+1
|\
| * Issue #26304: Change "allows to <verb>" to "allows <verb>ing" or similarMartin Panter2016-02-101-1/+1
| | | | | | | | | | The original form is incorrect grammar and feels awkward, even though the meaning is clear.
| * code_richcompare() now uses the constants typesVictor Stinner2016-01-221-1/+10
| | | | | | | | | | | | | | | | | | Issue #25843: When compiling code, don't merge constants if they are equal but have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now correctly compiled to two different functions: f1() returns 1 (int) and f2() returns 1.0 (int), even if 1 and 1.0 are equal. Add a new _PyCode_ConstantKey() private function.
* | Add ast.ConstantVictor Stinner2016-01-252-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26146: Add a new kind of AST node: ast.Constant. It can be used by external AST optimizers, but the compiler does not emit directly such node. An optimizer can replace the following AST nodes with ast.Constant: * ast.NameConstant: None, False, True * ast.Num: int, float, complex * ast.Str: str * ast.Bytes: bytes * ast.Tuple if items are constants too: tuple * frozenset Update code to accept ast.Constant instead of ast.Num and/or ast.Str: * compiler * docstrings * ast.literal_eval() * Tools/parser/unparse.py
* | Use Py_uintptr_t for atomic pointersVictor Stinner2016-01-221-3/+3
| | | | | | | | | | | | | | | | Issue #26161: Use Py_uintptr_t instead of void* for atomic pointers in pyatomic.h. Use atomic_uintptr_t when <stdatomic.h> is used. Using void* causes compilation warnings depending on which implementation of atomic types is used.
* | code_richcompare() now uses the constants typesVictor Stinner2016-01-221-1/+10
| | | | | | | | | | | | | | | | | | Issue #25843: When compiling code, don't merge constants if they are equal but have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now correctly compiled to two different functions: f1() returns 1 (int) and f2() returns 1.0 (int), even if 1 and 1.0 are equal. Add a new _PyCode_ConstantKey() private function.
* | merge from 3.5Senthil Kumaran2016-01-211-7/+7
|\ \ | |/ | | | | | | | | | | issue25909 - Correct the documentation of PyMapping_Items, PyMapping_Keys and PyMapping_Values in Include/abstract.h and Doc/c-api/mapping.rst. Patch contributed by Sonali Gupta.
| * issue25909 - Correct the documentation of PyMapping_Items, PyMapping_Keys andSenthil Kumaran2016-01-211-7/+7
| | | | | | | | | | | | PyMapping_Values in Include/abstract.h and Doc/c-api/mapping.rst. Patch contributed by Sonali Gupta.
* | co_lnotab supports negative line number deltaVictor Stinner2016-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26107: The format of the co_lnotab attribute of code objects changes to support negative line number delta. Changes: * assemble_lnotab(): if line number delta is less than -128 or greater than 127, emit multiple (offset_delta, lineno_delta) in co_lnotab * update functions decoding co_lnotab to use signed 8-bit integers - dis.findlinestarts() - PyCode_Addr2Line() - _PyCode_CheckLineNumber() - frame_setlineno() * update lnotab_notes.txt * increase importlib MAGIC_NUMBER to 3361 * document the change in What's New in Python 3.6 * cleanup also PyCode_Optimize() to use better variable names
* | Merge 3.5Victor Stinner2016-01-201-0/+10
|\ \ | |/ | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
| * Add _PyThreadState_UncheckedGet()Victor Stinner2016-01-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which gets the current thread state, but don't call Py_FatalError() if it is NULL. Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to no more expose complex and private atomic types. Atomic types depends on the compiler or can even depend on compiler options. The new function _PyThreadState_UncheckedGet() allows to get the variable value without having to care of the exact implementation of atomic types. Changes: * Replace direct usage of the _PyThreadState_Current variable with a call to _PyThreadState_UncheckedGet(). * In pystate.c, replace direct usage of the _PyThreadState_Current variable with the PyThreadState_GET() macro for readability. * Document also PyThreadState_Get() in pystate.h
* | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-252-7/+7
| | | | | | | | private functions.
* | Issue #25923: Added the const qualifier to static constant arrays.Serhiy Storchaka2015-12-252-3/+3
| |
* | Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-0/+26
|\ \ | |/ | | | | macro Py_SETREF.
| * Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-0/+26
| | | | | | | | macro Py_SETREF.
* | Issue #25914: Fixed and simplified OrderedDict.__sizeof__.Serhiy Storchaka2015-12-221-1/+1
|\ \ | |/
| * Issue #25914: Fixed and simplified OrderedDict.__sizeof__.Serhiy Storchaka2015-12-221-1/+1
| |
* | Issue #25701: Merge set and delete documentation from 3.5Martin Panter2015-12-081-10/+10
|\ \ | |/
| * Issue #25701: Document C API functions that both set and delete objectsMartin Panter2015-12-081-10/+10
| | | | | | | | | | | | Also document that the separate functions that delete objects are preferred; using PyObject_SetAttr(), _SetAttrString(), and PySequence_SetItem() to delete is deprecated.
| * Post-release fixups for Python 3.5.1.Larry Hastings2015-12-071-1/+1
| |
| * Version bump for 3.5.1 final.v3.5.1Larry Hastings2015-12-061-3/+3
| |
| * Post-release updates for Python 3.5.1rc1.Larry Hastings2015-11-231-1/+1
| |
| * Version bump for Python 3.5.1rc1.v3.5.1rc1Larry Hastings2015-11-221-4/+4
| |
| * Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner2015-11-061-2/+3
| | | | | | | | compiling AST from Python objects.
* | Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failureMartin Panter2015-11-301-0/+1
| |
* | Issue #25558: Use compile-time asserts.Serhiy Storchaka2015-11-071-0/+4
| |
* | Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner2015-11-061-2/+3
| | | | | | | | compiling AST from Python objects.
* | Issue 25483: Add an opcode to make f-string formatting more robust.Eric V. Smith2015-11-032-0/+9
| |
* | Issue #25523: Merge a-to-an corrections from 3.5.Serhiy Storchaka2015-11-021-2/+2
|\ \ | |/
| * Issue #25523: Merge a-to-an corrections from 3.4.Serhiy Storchaka2015-11-021-2/+2
| |\
| | * Issue #25523: Further a-to-an corrections.Serhiy Storchaka2015-11-021-2/+2
| | |
* | | Issue #25523: Merge a-to-an corrections from 3.5Martin Panter2015-11-022-3/+3
|\ \ \ | |/ /
| * | Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-022-3/+3
| |\ \ | | |/
| | * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-022-3/+3
| | | | | | | | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | | Add _PyBytesWriter_Resize() functionVictor Stinner2015-10-141-1/+18
| | | | | | | | | | | | This function gives a control to the buffer size without using min_size.
* | | Modify _PyBytes_DecodeEscapeRecode() to use _PyBytesAPIVictor Stinner2015-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | * Don't overallocate by 400% when recode is needed: only overallocate on demand using _PyBytesWriter. * Use _PyLong_DigitValue to convert hexadecimal digit to int * Create _PyBytes_DecodeEscapeRecode() subfunction
* | | Optimize bytes.fromhex() and bytearray.fromhex()Victor Stinner2015-10-142-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now between 2x and 3.5x faster. Changes: * Use a fast-path working on a char* string for ASCII string * Use a slow-path for non-ASCII string * Replace slow hex_digit_to_int() function with a O(1) lookup in _PyLong_DigitValue precomputed table * Use _PyBytesWriter API to handle the buffer * Add unit tests to check the error position in error messages
* | | Optimize bytearray % argsVictor Stinner2015-10-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #25399: Don't create temporary bytes objects: modify _PyBytes_Format() to create work directly on bytearray objects. * Rename _PyBytes_Format() to _PyBytes_FormatEx() just in case if something outside CPython uses it * _PyBytes_FormatEx() now uses (char*, Py_ssize_t) for the input string, so bytearray_format() doesn't need tot create a temporary input bytes object * Add use_bytearray parameter to _PyBytes_FormatEx() which is passed to _PyBytesWriter, to create a bytearray buffer instead of a bytes buffer Most formatting operations are now between 2.5 and 5 times faster.
* | | Add use_bytearray attribute to _PyBytesWriterVictor Stinner2015-10-141-4/+8
| | | | | | | | | | | | | | | Issue #25399: Add a new use_bytearray attribute to _PyBytesWriter to use a bytearray buffer, instead of using a bytes object.
* | | Merge 3.5 (sys.setrecursionlimit)Victor Stinner2015-10-121-3/+9
|\ \ \ | |/ /
| * | sys.setrecursionlimit() now raises RecursionErrorVictor Stinner2015-10-121-3/+9
| | | | | | | | | | | | | | | | | | | | | Issue #25274: sys.setrecursionlimit() now raises a RecursionError if the new recursion limit is too low depending at the current recursion depth. Modify also the "lower-water mark" formula to make it monotonic. This mark is used to decide when the overflowed flag of the thread state is reset.
* | | Relax _PyBytesWriter APIVictor Stinner2015-10-121-7/+7
| | | | | | | | | | | | | | | | | | | | | Don't require _PyBytesWriter pointer to be a "char *". Same change for _PyBytesWriter_WriteBytes() parameter. For example, binascii uses "unsigned char*".
* | | Issue #25349: Optimize bytes % intVictor Stinner2015-10-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Optimize bytes.__mod__(args) for integere formats: %d (%i, %u), %o, %x and %X. _PyBytesWriter is now used to format directly the integer into the writer buffer, instead of using a temporary bytes object. Formatting is between 30% and 50% faster on a microbenchmark.
* | | Add _PyBytesWriter_WriteBytes() to factorize the codeVictor Stinner2015-10-091-0/+7
| | |
* | | _PyBytesWriter: rename size attribute to min_sizeVictor Stinner2015-10-091-2/+3
| | |
* | | Issue #25318: cleanup code _PyBytesWriterVictor Stinner2015-10-091-2/+2
| | | | | | | | | | | | | | | | | | Rename "stack buffer" to "small buffer". Add also an assertion in _PyBytesWriter_GetPos().
* | | Issue #25318: Move _PyBytesWriter to bytesobject.cVictor Stinner2015-10-081-0/+52
| | | | | | | | | | | | Declare also the private API in bytesobject.h.
* | | Issue #25318: Add _PyBytesWriter APIVictor Stinner2015-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new private API to optimize Unicode encoders. It uses a small buffer allocated on the stack and supports overallocation. Use _PyBytesWriter API for UCS1 (ASCII and Latin1) and UTF-8 encoders. Enable overallocation for the UTF-8 encoder with error handlers. unicode_encode_ucs1(): initialize collend to collstart+1 to not check the current character twice, we already know that it is not ASCII.
* | | Issue #24483: C implementation of functools.lru_cache() now calculates key'sSerhiy Storchaka2015-10-021-0/+4
|\ \ \ | |/ / | | | | | | hash only once.
| * | Issue #24483: C implementation of functools.lru_cache() now calculates key'sSerhiy Storchaka2015-10-021-0/+4
| | | | | | | | | | | | hash only once.