summaryrefslogtreecommitdiffstats
path: root/Doc
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730)Stefan Krah2019-02-021-1/+8
|
* bpo-26256: Document algorithm speed for the Decimal module. (#4808)Cheryl Sabella2019-02-021-0/+20
|
* bpo-35537: Add setsid parameter to os.posix_spawn() and os.posix_spawnp() ↵Joannah Nanjekye2019-02-011-2/+10
| | | | (GH-11608)
* bpo-35766: Merge typed_ast back into CPython (GH-11645)Guido van Rossum2019-01-313-1/+32
|
* 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-312-1/+16
| | | | | | * 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-311-6/+6
|
* bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700)Steve Dower2019-01-302-9/+18
|
* 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
|
* 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.
* bpo-34134: Advise to use imap or imap_unordered when handling long ↵Windson yang2019-01-251-1/+5
| | | | iterables. (gh-8324)
* bpo-35224: PEP 572 Implementation (#10497)Emily Morehouse2019-01-242-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-35537: subprocess can use posix_spawn with pipes (GH-11575)Victor Stinner2019-01-231-2/+2
| | | | | | * 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-35781: Changed references to deprecated 'warn' method in logging ↵yuji38kwmt2019-01-232-4/+4
| | | | documentation in favour of 'warning' (GH-11654)
* bpo-35722: Updated the documentation for the 'disable_existing_loggers' ↵Géry Ogam2019-01-232-10/+10
| | | | parameter (GH-11525)
* bpo-35713: Rework Python initialization (GH-11647)Victor Stinner2019-01-221-0/+4
| | | | | | | | | | | | | | | | | | | * The PyByteArray_Init() and PyByteArray_Fini() functions have been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were excluded from the limited API (stable ABI), and were not documented. * Move "_PyXXX_Init()" and "_PyXXX_Fini()" declarations from Include/cpython/pylifecycle.h to Include/internal/pycore_pylifecycle.h. Replace "PyAPI_FUNC(TYPE)" with "extern TYPE". * _PyExc_Init() now returns an error on failure rather than calling Py_FatalError(). Move macros inside _PyExc_Init() and undefine them when done. Rewrite macros to make them look more like statement: add ";" when using them, add "do { ... } while (0)". * _PyUnicode_Init() now returns a _PyInitError error rather than call Py_FatalError(). * Move stdin check from _PySys_BeginInit() to init_sys_streams(). * _Py_ReadyTypes() now returns a _PyInitError error rather than calling Py_FatalError().
* bpo-33416: Add end positions to Python AST (GH-11605)Ivan Levkivskyi2019-01-221-9/+31
| | | | | | | | | | | | | | | | | | The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points: * It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`. * I add end position information to both CST and AST. Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient. * Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear. * For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in ```python class C: pass pass ``` the end line and end column for the class definition is (2, 8). * For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node. * I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing. An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.
* Add information about DeprecationWarning for invalid escaped characters in ↵Pablo Galindo2019-01-201-1/+4
| | | | the re module (GH-5255)
* bpo-21257: document http.client.parse_headers (GH-11443)Ashwin Ramaswami2019-01-181-0/+19
| | | Document http.client.parse_headers
* bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)Serhiy Storchaka2019-01-181-0/+7
|
* bpo-23156: Remove obsolete tix install directions (GH-11595)Terry Jan Reedy2019-01-181-11/+0
| | | Tix was deprecated in 3.6 and the doc is wrong. New users should use ttk.
* bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)Dong-hee Na2019-01-171-0/+2
| | | Add a deprecated warning for the threading.Thread.isAlive() method.
* Fixes typo in asyncio.queue doc (GH-11581)Slam2019-01-171-1/+1
| | | | | | | Typo fix for method doc, I'm pretty sure coro is meant, because there's no consumer threads for thread-unsafe queue. Most probably this piece of doc was copied from `queue.Queue` There's not BPO bug for this, afaik.
* bpo-35486: Note Py3.6 import system API requirement change (GH-11540)Nick Coghlan2019-01-172-1/+13
| | | | | | | | | | While the introduction of ModuleNotFoundError was fully backwards compatible on the import API consumer side, folks providing alternative implementations of `__import__` need to make an update to be forward compatible with clients that start relying on the new subclass. https://bugs.python.org/issue35486
* Revert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)Victor Stinner2019-01-161-1/+2
| | | This reverts commit 07858894689047c77f9c12ddc061d30681368d19.
* bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)Victor Stinner2019-01-161-2/+1
| | | | The subprocess module can now use the os.posix_spawnp() function, if it is available, to locate the program in the PATH.
* bpo-35674: Add os.posix_spawnp() (GH-11554)Joannah Nanjekye2019-01-161-0/+17
| | | Add a new os.posix_spawnp() function.
* bpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)Victor Stinner2019-01-151-0/+9
| | | | | | | | | | | | The subprocess module can now use the os.posix_spawn() function in some cases for better performance. Currently, it is only used on macOS and Linux (using glibc 2.24 or newer) if all these conditions are met: * executable path contains a directory * close_fds=False * preexec_fn, pass_fds, cwd, stdin, stdout, stderr and start_new_session parameters are not set Co-authored-by: Joannah Nanjekye <nanjekyejoannah@gmail.com>
* bpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)Henry Chen2019-01-151-1/+1
| | | Show correct number of repeats.
* bpo-29707: Document that os.path.ismount() is not able to reliable detect ↵Serhiy Storchaka2019-01-151-3/+4
| | | | bind mounts. (GH-11238)
* bpo-34512: Document platform-specific strftime() behavior for non-ASCII ↵Alexey Izbyshev2019-01-121-0/+6
| | | | format strings (GH-8948)
* bpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)Joannah Nanjekye2019-01-111-2/+2
| | | | | | Document that the time.CLOCK_MONOTONIC_RAW constant is now also available on macOS 10.12. Co-authored-by: Ricardo Fraile <rfraile@rfraile.eu>
* bpo-32146: Add documentation about frozen executables on Unix (GH-5850)Bo Bayles2019-01-101-0/+7
|
* bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)Joannah Nanjekye2019-01-102-0/+18
|
* Update bugs.rst (GH-9648)Andre Delfino2019-01-091-1/+1
|
* bpo-35404: Clarify how to import _structure in email.message doc (GH-10886)Charles-Axel Dein2019-01-091-1/+1
|
* Add example to the documentation for calling unittest.mock.patch with ↵Pablo Galindo2019-01-091-7/+28
| | | | create=True (GH-11056)
* bpo-35568: add 'raise_signal' function (GH-11335)Vladimir Matveev2019-01-081-0/+7
| | | | | | As in title, expose C `raise` function as `raise_function` in `signal` module. Also drop existing `raise_signal` in `_testcapi` module and replace all usages with new function. https://bugs.python.org/issue35568
* bpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)chrullrich2019-01-081-1/+1
|
* bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)Ville Skyttä2019-01-041-8/+17
| | | | https://bugs.python.org/issue35631
* bpo-31450: Remove documentation mentioning that subprocess's child_traceback ↵Harmandeep Singh2019-01-031-3/+1
| | | | is available with the parent process (GH-11422)
* bpo-35525: Correct the argument name for NNTP.starttls() (GH-11310)Harmandeep Singh2019-01-021-2/+2
|
* Bump copyright years to 2019. (GH-11404)Benjamin Peterson2019-01-022-2/+2
|
* Fix typo in documentation of AbstractEventLoopPolicy.set_child_watcher() ↵sth2018-12-301-1/+1
| | | | | (GH-11369) `set_child_watcher()` *sets* the watcher.
* bpo-28097: IDLE - Add Previous/Next History to Shell menu (#11325)Cheryl Sabella2018-12-281-0/+6
|