summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Apply PEP 7 suggestions from code reviewGuido van Rossum2020-05-141-6/+12
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Remove debug print() callsGuido van Rossum2020-05-141-4/+0
|
* Add thorough test, and fix found issues in traceback.pyGuido van Rossum2020-05-132-13/+38
|
* Fix test (and rebase)Guido van Rossum2020-05-131-1/+1
|
* Refactor print_error_text()Guido van Rossum2020-05-131-21/+43
|
* Misc/NEWS blurbGuido van Rossum2020-05-131-0/+2
|
* bpo-40612: Fix SyntaxError edge cases in traceback moduleGuido van Rossum2020-05-132-10/+14
|
* bpo-40334: Always show the caret on SyntaxErrors (GH-20050)Lysandros Nikolaou2020-05-135-192/+293
| | | | | | | | | | | | | | This commit fixes SyntaxError locations when the caret is not displayed, by doing the following: - `col_number` always gets set to the location of the offending node/expr. When no caret is to be displayed, this gets achieved by setting the object holding the error line to None. - Introduce a new function `_PyPegen_raise_error_known_location`, which can be called, when an arbitrary `lineno`/`col_offset` needs to be passed. This function then gets used in the grammar (through some new macros and inline functions) so that SyntaxError locations of the new parser match that of the old.
* bpo-34790: add version of removal of explicit passing of coros to ↵jack11422020-05-132-1/+2
| | | | `asyncio.wait`'s documentation (#20008)
* bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-20069)Dong-hee Na2020-05-131-0/+8
|
* bpo-40331: Increase test coverage for the statistics module (GH-19608)Tzanetos Balitsaris2020-05-131-0/+60
|
* bpo-40602: Optimize _Py_hashtable_get_ptr() (GH-20066)Victor Stinner2020-05-131-24/+23
| | | | | | | _Py_hashtable_get_entry_ptr() avoids comparing the entry hash: compare directly keys. Move _Py_hashtable_get_entry_ptr() just after _Py_hashtable_get_entry_generic().
* bpo-40609: _Py_hashtable_t values become void* (GH-20065)Victor Stinner2020-05-134-303/+140
| | | | | | | | | | | | | | | | | | | | | _Py_hashtable_t values become regular "void *" pointers. * Add _Py_hashtable_entry_t.data member * Remove _Py_hashtable_t.data_size member * Remove _Py_hashtable_t.get_func member. It is no longer needed to specialize _Py_hashtable_get() for a specific value size, since all entries now have the same size (void*). * Remove the following macros: * _Py_HASHTABLE_GET() * _Py_HASHTABLE_SET() * _Py_HASHTABLE_SET_NODATA() * _Py_HASHTABLE_POP() * Rename _Py_hashtable_pop() to _Py_hashtable_steal() * _Py_hashtable_foreach() callback now gets key and value rather than entry. * Remove _Py_hashtable_value_destroy_func type. value_destroy_func callback now only has a single parameter: data (void*).
* bpo-40609: _tracemalloc allocates traces (GH-20064)Victor Stinner2020-05-133-102/+117
| | | | | | | | | | | | | Rewrite _tracemalloc to store "trace_t*" rather than directly "trace_t" in traces hash tables. Traces are now allocated on the heap memory, outside the hash table. Add tracemalloc_copy_traces() and tracemalloc_copy_domains() helper functions. Remove _Py_hashtable_copy() function since there is no API to copy a key or a value. Remove also _Py_hashtable_delete() function which was commented.
* bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)Victor Stinner2020-05-134-52/+73
| | | | | | Add key_destroy_func and value_destroy_func parameters to _Py_hashtable_new_full(). marshal.c and _tracemalloc.c use these destroy functions.
* bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)Victor Stinner2020-05-134-188/+120
| | | | | | | | | | Rewrite _Py_hashtable_t type to always store the key as a "const void *" pointer. Add an explicit "key" member to _Py_hashtable_entry_t. Remove _Py_hashtable_t.key_size member. hash and compare functions drop their hash table parameter, and their 'key' parameter type becomes "const void *".
* bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)Victor Stinner2020-05-132-160/+174
| | | | | | | | | | Rewrite how the _tracemalloc module stores traces of other domains. Rather than storing the domain inside the key, it now uses a new hash table with the domain as the key, and the data is a per-domain traces hash table. * Add tracemalloc_domain hash table. * Remove _Py_tracemalloc_config.use_domain. * Remove pointer_t and related functions.
* Fix Wikipedia link (GH-20031)Allen Guo2020-05-121-5/+5
|
* bpo-40501: Replace ctypes code in uuid with native module (GH-19948)Steve Dower2020-05-129-186/+248
|
* bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)Victor Stinner2020-05-123-5/+13
| | | | | Add a new _Py_HashPointerRaw() function which avoids replacing -1 with -2 to micro-optimize hash table using pointer keys: using _Py_hashtable_hash_ptr() hash function.
* bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024)scoder2020-05-125-4/+10
| | | | | … now that we allow subtypes of PyCFunction. Also add PyCMethod_CheckExact() and PyCMethod_Check() for checks against the PyCMethod subtype.
* bpo-40596: Fix str.isidentifier() for non-canonicalized strings containing ↵Serhiy Storchaka2020-05-123-4/+31
| | | | non-BMP characters on Windows. (GH-20053)
* bpo-40602: Optimize _Py_hashtable for pointer keys (GH-20051)Victor Stinner2020-05-122-94/+153
| | | | | | | | | | | | | | | Optimize _Py_hashtable_get() and _Py_hashtable_get_entry() for pointer keys: * key_size == sizeof(void*) * hash_func == _Py_hashtable_hash_ptr * compare_func == _Py_hashtable_compare_direct Changes: * Add get_func and get_entry_func members to _Py_hashtable_t * Convert _Py_hashtable_get() and _Py_hashtable_get_entry() functions to static nline functions. * Add specialized get and get entry for pointer keys.
* bpo-40593: Improve syntax errors for invalid characters in source code. ↵Serhiy Storchaka2020-05-1210-43/+90
| | | | (GH-20033)
* bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)Batuhan Taskaya2020-05-113-13/+0
| | | These were added by mistake (see https://bugs.python.org/issue39481#msg366288).
* bpo-40480: restore ability to join fnmatch.translate() results (GH-20049)Tim Peters2020-05-112-7/+34
| | | | | | | In translate(), generate unique group names across calls. The restores the undocumented ability to get a valid regexp by joining multiple translate() results via `|`.
* bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() (GH-20046)Victor Stinner2020-05-121-3/+4
| | | | | | | _Py_hashtable_new() now uses PyMem_Malloc/PyMem_Free allocator by default, rather than PyMem_RawMalloc/PyMem_RawFree. PyMem_Malloc is faster than PyMem_RawMalloc for memory blocks smaller than or equal to 512 bytes.
* bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)Victor Stinner2020-05-128-13/+26
| | | | | | | * Move Modules/hashtable.h to Include/internal/pycore_hashtable.h * Move Modules/hashtable.c to Python/hashtable.c * Python is now linked to hashtable.c. _tracemalloc is no longer linked to hashtable.c. Previously, marshal.c got hashtable.c via _tracemalloc.c which is built as a builtin module.
* bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)Raymond Hettinger2020-05-114-1/+57
|
* bpo-39465: Don't access directly _Py_Identifier members (GH-20043)Victor Stinner2020-05-124-11/+11
| | | | | * Replace id->object with _PyUnicode_FromId(&id) * Use _Py_static_string_init(str) macro to initialize statically name_op in typeobject.c.
* bpo-40334: produce specialized errors for invalid del targets (GH-19911)Shantanu2020-05-114-181/+352
|
* bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset ↵Hai Shi2020-05-113-5/+18
| | | | (GH-20026)
* bpo-40561: Add docstrings for webbrowser open functions (GH-19999)Brad Solomon2020-05-112-0/+17
| | | | Co-authored-by: Brad Solomon <brsolomon@deloitte.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-36346: array: Don't use deprecated APIs (GH-19653)Inada Naoki2020-05-114-55/+63
| | | | | | | | * Py_UNICODE -> wchar_t * Py_UNICODE -> unicode in Argument Clinic * PyUnicode_AsUnicode -> PyUnicode_AsWideCharString * Don't use "u#" format. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError() (GH-20018)scoder2020-05-111-1/+3
| | | | | Avoid unnecessary overhead in _PyDict_GetItemIdWithError() by calling _PyDict_GetItem_KnownHash() instead of the more generic PyDict_GetItemWithError(), since we already know the hash of interned strings.
* bpo-40585: Normalize errors messages in codeop when comparing them (GH-20030)Pablo Galindo2020-05-113-0/+17
| | | | | | With the new parser, the error message contains always the trailing newlines, causing the comparison of the repr of the error messages in codeop to fail. This commit makes the new parser mirror the old parser's behaviour regarding trailing newlines.
* Improve code clarity for the set lookup logic (GH-20028)Raymond Hettinger2020-05-101-125/+55
|
* bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)Serhiy Storchaka2020-05-101-1/+4
| | | | * Add the terminating period. * Omit module name for builtin types.
* bpo-40397: Fix subscription of nested generic alias without parameters. ↵Serhiy Storchaka2020-05-102-3/+16
| | | | (GH-20021)
* bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)Sergey Fedoseev2020-05-103-23/+19
| | | | | | | | | * bpo-37986: Improve perfomance of PyLong_FromDouble() * Use strict bound check for safety and symmetry * Remove possibly outdated performance claims Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)Victor Stinner2020-05-103-129/+147
| | | | | | | | | | | | | | | Convert posixmodule.c ("posix" or "nt" module) to the multiphase initialization (PEP 489). * Create the module using PyModuleDef_Init(). * Create ScandirIteratorType and DirEntryType with the new PyType_FromModuleAndSpec() (PEP 573) * Get the module state from ScandirIteratorType and DirEntryType with the new PyType_GetModule() (PEP 573) * Pass module to functions which access the module state. * convert_sched_param() gets a new module parameter. It is now called directly since Argument Clinic doesn't support passing the module to an argument converter callback. * Remove _posixstate_global macro.
* bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAlias ↵Serhiy Storchaka2020-05-102-80/+89
| | | | (GH-19984)
* Add link to Enum class (GH-19884)Andre Delfino2020-05-101-1/+1
|
* bpo-40334: Avoid collisions between parser variables and grammar variables ↵Pablo Galindo2020-05-095-5716/+5758
| | | | | | | | | | | | | | | (GH-19987) This is for the C generator: - Disallow rule and variable names starting with `_` - Rename most local variable names generated by the parser to start with `_` Exceptions: - Renaming `p` to `_p` will be a separate PR - There are still some names that might clash, e.g. - anything starting with `Py` - C reserved words (`if` etc.) - Macros like `EXTRA` and `CHECK`
* bpo-40570: Improve compatibility of uname_result with late-bound .platform ↵Jason R. Coombs2020-05-092-3/+19
| | | | | | | (#20015) * bpo-40570: Improve compatibility of uname_result with late-bound .platform. * Add test capturing ability to cast uname to a tuple.
* bpo-40566: Apply PEP 573 to abc module (GH-20005)Dong-hee Na2020-05-092-15/+20
|
* bpo-39791: Add files() to importlib.resources (GH-19722)Jason R. Coombs2020-05-087-102/+295
| | | | | | | | | * bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5). * 📜🤖 Added by blurb_it. * Add some documentation about the new objects added. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40502: Initialize n->n_col_offset (GH-19988)Joannah Nanjekye2020-05-082-0/+3
| | | | | | | | | | * initialize n->n_col_offset * 📜🤖 Added by blurb_it. * Move initialization Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)Raymond Hettinger2020-05-084-13/+116
|
* Make the first dataclass example more useful (GH-19994)Ned Batchelder2020-05-081-0/+2
|