summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34691: Compile _contextvars module into main Python library (GH-11741)Steve Dower2019-02-026-95/+8
|
* bpo-29734: nt._getfinalpathname handle leak (GH-740)Mark Becwar2019-02-023-8/+67
| | | Make sure that failure paths call CloseHandle outside of the function that failed
* bpo-32560: inherit the py launcher's STARTUPINFO (GH-9000)Shiva Saxena2019-02-022-1/+3
| | | https://bugs.python.org/issue32560
* bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730)Stefan Krah2019-02-024-10/+59
|
* bpo-33895: Relase GIL while calling functions that acquire Windows loader ↵Tony Roberts2019-02-028-6/+48
| | | | | lock (GH-7789) LoadLibrary, GetProcAddress, FreeLibrary and GetModuleHandle acquire the system loader lock. Calling these while holding the GIL will cause a deadlock on the rare occasion that another thread is detaching and needs to destroy its thread state at the same time.
* bpo-1104: msilib.SummaryInfo.GetProperty() truncates the string by one ↵Tzu-ping Chung2019-02-023-12/+46
| | | | | | character (GH-4517) Add one char to MsiSummaryInfoGetProperty() output Based on the patch in bpo-1104 by Anthony Tuininga (atuining) and Mark McMahon (markm).
* bpo-33316: PyThread_release_lock always fails (GH-6541)native-api2019-02-022-2/+4
| | | Use correct interpretation of return value from APIs.
* bpo-26256: Document algorithm speed for the Decimal module. (#4808)Cheryl Sabella2019-02-021-0/+20
|
* bpo-35813: Added shared_memory submodule of multiprocessing. (#11664)Davin Potts2019-02-024-0/+1310
| | | Added shared_memory submodule to multiprocessing in time for first alpha with cross-platform tests soon to follow.
* bpo-35879: Fix type comment leaks (GH-11728)Guido van Rossum2019-02-012-3/+9
| | | | | * Fix leak for # type: ignore * Fix the type comment leak
* bpo-35877: Add test for while loop named expression without parentheses ↵Emily Morehouse2019-02-011-1/+7
| | | | (GH-11726)
* bpo-35877: Make parenthesis optional for named expression in while statement ↵Xtreak2019-02-014-2/+5
| | | | | | | | (GH-11724) * Add parenthesis optional in named expressions for while statement * Add NEWS entry
* bpo-35864: fix namedtuple._asdict() docstring (GH-11720)Amador Pahim2019-02-011-1/+1
|
* bpo-35861: Fix SyntaxWarning in test_named_expressions.py (GH-11722)Joannah Nanjekye2019-02-011-1/+1
|
* bpo-35766 follow-up: Kill half-support for FunctionType in PyAST_obj2mod ↵Guido van Rossum2019-02-012-6/+4
| | | | | | | (#11714) See https://github.com/python/cpython/pull/11645/files/229874c612df868e7ae3e997e159915f49d16542#r252631862 https://bugs.python.org/issue35766
* bpo-35537: Fix function name in os.posix_spawnp() errors (GH-11719)Victor Stinner2019-02-011-11/+13
|
* bpo-35537: Skip test_start_new_session() of posix_spawn (GH-11718)Victor Stinner2019-02-011-0/+2
| | | The test fails. Skip the test until a fix can be found.
* bpo-35537: Add setsid parameter to os.posix_spawn() and os.posix_spawnp() ↵Joannah Nanjekye2019-02-015-33/+84
| | | | (GH-11608)
* Speed-up argument parsing for common cases in deque.__init__()(GH-11717)Raymond Hettinger2019-02-011-3/+7
|
* Consistently move the misses update to just before the user function call ↵Raymond Hettinger2019-01-312-6/+8
| | | | (GH-11715)
* bpo-35766: Merge typed_ast back into CPython (GH-11645)Guido van Rossum2019-01-3130-651/+2039
|
* doc: http: Fix enum name for status code 416 (GH-11689)Phil Jones2019-01-311-1/+1
|
* bpo-35864: Replace OrderedDict with regular dict in namedtuple() (#11708)Raymond Hettinger2019-01-314-2/+21
| | | | | | * Change from OrderedDict to a regular dict * Add blurb
* bpo-33504: fix wrong "versionchanged" (GH-11712)Inada Naoki2019-01-311-4/+4
|
* bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014)Michael Selik2019-01-313-8/+9
|
* bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700)Steve Dower2019-01-305-27/+63
|
* Document differences between random.choices() and random.choice(). (GH-11703)Raymond Hettinger2019-01-301-0/+7
|
* bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb ↵João Matos2019-01-301-0/+4
| | | | documentation. (GH-11691)
* bpo-25592: Improve documentation of distutils data_files (GH-9767)jdemeyer2019-01-301-11/+14
|
* Move float conversion into a macro. Apply to fsum (GH-11698)Raymond Hettinger2019-01-301-49/+32
|
* subprocess: close pipes/fds by using ExitStack (GH-11686)Giampaolo Rodola2019-01-292-17/+22
| | | | | | | Close pipes/fds in subprocess by using ExitStack. "In case of premature failure on X.Close() or os.close(X) the remaining pipes/fds will remain "open". Perhaps it makes sense to use contextlib.ExitStack." - Rationale: https://github.com/python/cpython/pull/11575#discussion_r250288394
* bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)Andreas Schwab2019-01-292-1/+2
| | | | | | This fixes the ctypes.test.test_structures.StructureTestCase test. https://bugs.python.org/issue35847
* Fast path for int inputs to math.dist() and math.hypot() (GH-11692)Raymond Hettinger2019-01-282-4/+34
|
* bpo-35701: Update doc for UUID weak referencing (GH-11621)David H2019-01-281-5/+0
|
* Fix typo: class declaration (GH-11678)nu_no2019-01-271-1/+1
|
* Clarify U-mode deprecation in open() (GH-11646)Nick Coghlan2019-01-271-1/+8
| | | | | | | | | | The previous wording could be read as saying that universal newlines mode itself was deprecated, when it's only the 'U' character in the mode field that should be avoided. The update also moves the description of the 'U' mode character out of the mode table, as the longer explanation was overly intrusive as a table entry and overshadowed the actually useful mode characters.
* Fix docstr/comment typos in _use_posix_spawn(). (GH-11684)Gregory P. Smith2019-01-261-11/+10
|
* bpo-35780: Fix errors in lru_cache() C code (GH-11623)Raymond Hettinger2019-01-264-89/+234
|
* bpo-35811: Avoid propagating venv settings when launching via py.exe (GH-11677)Steve Dower2019-01-252-0/+12
|
* bpo-35797: Fix default executable used by the multiprocessing module (GH-11676)Steve Dower2019-01-253-1/+22
|
* bpo-34134: Advise to use imap or imap_unordered when handling long ↵Windson yang2019-01-251-1/+5
| | | | iterables. (gh-8324)
* bpo-35814: Allow same r.h.s. in annotated assignments as in normal ones ↵Ivan Levkivskyi2019-01-256-6/+23
| | | | | | (GH-11667)
* bpo-35224: Add support for NamedExpr to unparse.py (GH-11670)Victor Stinner2019-01-251-0/+7
|
* bpo-35224: PEP 572 Implementation (#10497)Emily Morehouse2019-01-2427-655/+1472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add tokenization of := - Add token to Include/token.h. Add token to documentation in Doc/library/token.rst. - Run `./python Lib/token.py` to regenerate Lib/token.py. - Update Parser/tokenizer.c: add case to handle `:=`. * Add initial usage of := in grammar. * Update Python.asdl to match the grammar updates. Regenerated Include/Python-ast.h and Python/Python-ast.c * Update AST and compiler files in Python/ast.c and Python/compile.c. Basic functionality, this isn't scoped properly * Regenerate Lib/symbol.py using `./python Lib/symbol.py` * Tests - Fix failing tests in test_parser.py due to changes in token numbers for internal representation * Tests - Add simple test for := token * Tests - Add simple tests for named expressions using expr and suite * Tests - Update number of levels for nested expressions to prevent stack overflow * Update symbol table to handle NamedExpr * Update Grammar to allow assignment expressions in if statements. Regenerate Python/graminit.c accordingly using `make regen-grammar` * Tests - Add additional tests for named expressions in RoundtripLegalSyntaxTestCase, based on examples and information directly from PEP 572 Note: failing tests are currently commented out (4 out of 24 tests currently fail) * Tests - Add temporary syntax test failure tests in test_parser.py Note: There is an outstanding TODO for this -- syntax tests need to be moved to a different file (presumably test_syntax.py), but this is covering what needs to be tested at the moment, and it's more convenient to run a single test for the time being * Add support for allowing assignment expressions as function argument annotations. Uncomment tests for these cases because they all pass now! * Tests - Move existing syntax tests out of test_parser.py and into test_named_expressions.py. Refactor syntax tests to use unittest * Add TargetScopeError exception to extend SyntaxError Note: This simply creates the TargetScopeError exception, it is not yet used anywhere * Tests - Update tests per PEP 572 Continue refactoring test suite: The named expression test suite now checks for any invalid cases that throw exceptions (no longer limited to SyntaxErrors), assignment tests to ensure that variables are properly assigned, and scope tests to ensure that variable availability and values are correct Note: - There are still tests that are marked to skip, as they are not yet implemented - There are approximately 300 lines of the PEP that have not yet been addressed, though these may be deferred * Documentation - Small updates to XXX/todo comments - Remove XXX from child description in ast.c - Add comment with number of previously supported nested expressions for 3.7.X in test_parser.py * Fix assert in seq_for_testlist() * Cleanup - Denote "Not implemented -- No keyword args" on failing test case. Fix PEP8 error for blank lines at beginning of test classes in test_parser.py * Tests - Wrap all file opens in `with...as` to ensure files are closed * WIP: handle f(a := 1) * Tests and Cleanup - No longer skips keyword arg test. Keyword arg test now uses a simpler test case and does not rely on an external file. Remove print statements from ast.c * Tests - Refactor last remaining test case that relied on on external file to use a simpler test case without the dependency * Tests - Add better description of remaning skipped tests. Add test checking scope when using assignment expression in a function argument * Tests - Add test for nested comprehension, testing value and scope. Fix variable name in skipped comprehension scope test * Handle restriction of LHS for named expressions - can only assign to LHS of type NAME. Specifically, restrict assignment to tuples This adds an alternative set_context specifically for named expressions, set_namedexpr_context. Thus, context is now set differently for standard assignment versus assignment for named expressions in order to handle restrictions. * Tests - Update negative test case for assigning to lambda to match new error message. Add negative test case for assigning to tuple * Tests - Reorder test cases to group invalid syntax cases and named assignment target errors * Tests - Update test case for named expression in function argument - check that result and variable are set correctly * Todo - Add todo for TargetScopeError based on Guido's comment (https://github.com/python/cpython/commit/2b3acd37bdfc2d35e5094228c6684050d2aa8b0a#r30472562) * Tests - Add named expression tests for assignment operator in function arguments Note: One of two tests are skipped, as function arguments are currently treating an assignment expression inside of parenthesis as one child, which does not properly catch the named expression, nor does it count arguments properly * Add NamedStore to expr_context. Regenerate related code with `make regen-ast` * Add usage of NamedStore to ast_for_named_expr in ast.c. Update occurances of checking for Store to also handle NamedStore where appropriate * Add ste_comprehension to _symtable_entry to track if the namespace is a comprehension. Initialize ste_comprehension to 0. Set set_comprehension to 1 in symtable_handle_comprehension * s/symtable_add_def/symtable_add_def_helper. Add symtable_add_def to handle grabbing st->st_cur and passing it to symtable_add_def_helper. This now allows us to call the original code from symtable_add_def by instead calling symtable_add_def_helper with a different ste. * Refactor symtable_record_directive to take lineno and col_offset as arguments instead of stmt_ty. This allows symtable_record_directive to be used for stmt_ty and expr_ty * Handle elevating scope for named expressions in comprehensions. * Handle error for usage of named expression inside a class block * Tests - No longer skip scope tests. Add additional scope tests * Cleanup - Update error message for named expression within a comprehension within a class. Update comments. Add assert for symtable_extend_namedexpr_scope to validate that we always find at least a ModuleScope if we don't find a Class or FunctionScope * Cleanup - Add missing case for NamedStore in expr_context_name. Remove unused var in set_namedexpr_content * Refactor - Consolidate set_context and set_namedexpr_context to reduce duplicated code. Special cases for named expressions are handled by checking if ctx is NamedStore * Cleanup - Add additional use cases for ast_for_namedexpr in usage comment. Fix multiple blank lines in test_named_expressions * Tests - Remove unnecessary test case. Renumber test case function names * Remove TargetScopeError for now. Will add back if needed * Cleanup - Small comment nit for consistency * Handle positional argument check with named expression * Add TargetScopeError exception definition. Add documentation for TargetScopeError in c-api docs. Throw TargetScopeError instead of SyntaxError when using a named expression in a comprehension within a class scope * Increase stack size for parser by 200. This is a minimal change (approx. 5kb) and should not have an impact on any systems. Update parser test to allow 99 nested levels again * Add TargetScopeError to exception_hierarchy.txt for test_baseexception.py_ * Tests - Major update for named expression tests, both in test_named_expressions and test_parser - Add test for TargetScopeError - Add tests for named expressions in comprehension scope and edge cases - Add tests for named expressions in function arguments (declarations and call sites) - Reorganize tests to group them more logically * Cleanup - Remove unnecessary comment * Cleanup - Comment nitpicks * Explicitly disallow assignment expressions to a name inside parentheses, e.g.: ((x) := 0) - Add check for LHS types to detect a parenthesis then a name (see note) - Add test for this scenario - Update tests for changed error message for named assignment to a tuple (also, see note) Note: This caused issues with the previous error handling for named assignment to a LHS that contained an expression, such as a tuple. Thus, the check for the LHS of a named expression must be changed to be more specific if we wish to maintain the previous error messages * Cleanup - Wrap lines more strictly in test file * Revert "Explicitly disallow assignment expressions to a name inside parentheses, e.g.: ((x) := 0)" This reverts commit f1531400ca7d7a2d148830c8ac703f041740896d. * Add NEWS.d entry * Tests - Fix error in test_pickle.test_exceptions by adding TargetScopeError to list of exceptions * Tests - Update error message tests to reflect improved messaging convention (s/can't/cannot) * Remove cases that cannot be reached in compile.c. Small linting update. * Update Grammar/Tokens to add COLONEQUAL. Regenerate all files * Update TargetScopeError PRE_INIT and POST_INIT, as this was purposefully left out when fixing rebase conflicts * Add NamedStore back and regenerate files * Pass along line number and end col info for named expression * Simplify News entry * Fix compiler warning and explicity mark fallthrough
* bpo-35717: Fix KeyError exception raised when using enums and compile (GH-11523)Rémi Lapeyre2019-01-244-1/+13
| | | https://bugs.python.org/issue17467
* bpo-35520: Fix build with dtrace support on certain systems. (#11194)Jakub Kulík2019-01-243-6/+10
|
* bpo-35767: Fix unittest.loader to allow partials as test_functions (#11600)Jason Fried2019-01-232-1/+19
|
* bpo-35537: subprocess can use posix_spawn with pipes (GH-11575)Victor Stinner2019-01-232-30/+66
| | | | | | * subprocess.Popen can now also use os.posix_spawn() with pipes, but only if pipe file descriptors are greater than 2. * Fix Popen._posix_spawn(): set '_child_created' attribute to True. * Add Popen._close_pipe_fds() helper function to factorize the code.
* bpo-35713: Reorganize sys module initialization (GH-11658)Victor Stinner2019-01-234-75/+96
| | | | | | | | | * Rename _PySys_BeginInit() to _PySys_InitCore(). * Rename _PySys_EndInit() to _PySys_InitMain(). * Add _PySys_Create(). It calls _PySys_InitCore() which becomes private. * Add _PySys_SetPreliminaryStderr(). * Rename _Py_ReadyTypes() to _PyTypes_Init(). * Misc code cleanup.
* bpo-35781: Changed references to deprecated 'warn' method in logging ↵yuji38kwmt2019-01-232-4/+4
| | | | documentation in favour of 'warning' (GH-11654)