Commit Graph

9685 Commits

Author SHA1 Message Date
Raymond Hettinger 9abb725cea Improve readability of random module examples (GH-11884)
Based on reviewer feedback from Allen Downey, convert ``lambda`` to ``def``.
2019-02-15 12:40:18 -08:00
Jack Wilsdon 903567e4f5 Fix the versionadded info for typing.NoReturn (GH-11880)
The earliest version that `typing.NoReturn` appears in is [3.5.4rc1](https://docs.python.org/3/whatsnew/changelog.html#python-3-5-4-release-candidate-1)
2019-02-15 11:20:28 -08:00
Emmanuel Arias 522630a746 bpo-36006: Fix versionchanged directive alignment in io module documentation (GH-11881)
https://bugs.python.org/issue36006
2019-02-15 11:02:38 -08:00
Lysandros Nikolaou 5723263a3a bpo-30410: Documentation of sys.stdin/out/err update to reflect change in 3.6 (GH-10264)
Documentation of sys.stdin/out/err update to reflect change in 3.6 on Windows to use UTF-8.

Wording by Eryk Sun and Paul Moore.



https://bugs.python.org/issue30410
2019-02-14 15:35:25 -08:00
Kevin Mai-Husan Chia d73ac0eba9 Fix typo: equivalent code of `async with cond` (GH-11681) 2019-02-13 18:39:25 -08:00
Cheryl Sabella 5680f6546d bpo-18283: Add support for bytes to shutil.which (GH-11818) 2019-02-13 12:25:10 +01:00
Eivind Teig 537b6caa56 bpo-22062: Updated docstring and documentation for pathlib (GH-8519)
Original patch by Mike Short


https://bugs.python.org/issue22062
2019-02-11 02:47:09 -08:00
Pablo Galindo 5033e315d2
Fix broken :ref: in asyncio docs (GH-11805) 2019-02-10 00:21:37 +00:00
Terry Jan Reedy 8a03ff2ff4
bpo-35833: Revise IDLE doc for control codes sent to Shell. (GH-11799)
Add  a code example block.
2019-02-08 22:51:51 -05:00
Pierre Glaser df8d2cde63 bpo-35911: add cell constructor (GH-11771)
Add a cell constructor, expose the cell type in the types module.
2019-02-07 19:36:48 +00:00
Pablo Galindo bc09851586 bpo-35606: Implement math.prod (GH-11359) 2019-02-06 23:04:02 -08:00
Harmandeep Singh cd90f6a369 bpo-20001: update pathlib landing image (GH-11304) 2019-02-05 19:16:13 +09:00
Stefan Krah d08ea70464
bpo-35845: Add order={'C', 'F', 'A'} parameter to memoryview.tobytes(). (#11730) 2019-02-02 18:57:41 +01:00
Cheryl Sabella 00e9c55d27 bpo-26256: Document algorithm speed for the Decimal module. (#4808) 2019-02-02 15:37:39 +01:00
Joannah Nanjekye 80c5dfe74b bpo-35537: Add setsid parameter to os.posix_spawn() and os.posix_spawnp() (GH-11608) 2019-02-01 11:05:22 +01:00
Guido van Rossum dcfcd146f8 bpo-35766: Merge typed_ast back into CPython (GH-11645) 2019-01-31 12:40:27 +01:00
Phil Jones d97daebfa6 doc: http: Fix enum name for status code 416 (GH-11689) 2019-01-31 19:08:57 +09:00
Raymond Hettinger 0bb4bdf0d9
bpo-35864: Replace OrderedDict with regular dict in namedtuple() (#11708)
* Change from OrderedDict to a regular dict

* Add blurb
2019-01-31 00:59:50 -08:00
Inada Naoki 0897e0c597
bpo-33504: fix wrong "versionchanged" (GH-11712) 2019-01-31 17:53:48 +09:00
Michael Selik 9f3f0931cf bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014) 2019-01-31 00:47:53 -08:00
Steve Dower a1f9a3332b
bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700) 2019-01-30 13:49:14 -08:00
Raymond Hettinger 40ebe948e9
Document differences between random.choices() and random.choice(). (GH-11703) 2019-01-30 13:30:20 -08:00
João Matos cf991e653a bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb documentation. (GH-11691) 2019-01-30 09:23:39 -08:00
nu_no dfc8bb987d Fix typo: class declaration (GH-11678) 2019-01-27 14:07:47 -08:00
Nick Coghlan 3171df3414
Clarify U-mode deprecation in open() (GH-11646)
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.
2019-01-28 02:21:11 +10:00
Windson yang 3bab40db96 bpo-34134: Advise to use imap or imap_unordered when handling long iterables. (gh-8324) 2019-01-25 13:01:41 +01:00
Emily Morehouse 8f59ee01be
bpo-35224: PEP 572 Implementation (#10497)
* 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 (2b3acd37bd (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
2019-01-24 16:49:56 -07:00
Géry Ogam f0c743604f bpo-35722: Updated the documentation for the 'disable_existing_loggers' parameter (GH-11525) 2019-01-23 07:12:39 +00:00
Ivan Levkivskyi 9932a22897
bpo-33416: Add end positions to Python AST (GH-11605)
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.
2019-01-22 11:18:22 +00:00
Pablo Galindo e8239b8e81
Add information about DeprecationWarning for invalid escaped characters in the re module (GH-5255) 2019-01-20 18:57:56 +00:00
Ashwin Ramaswami 478f829132 bpo-21257: document http.client.parse_headers (GH-11443)
Document http.client.parse_headers
2019-01-18 08:49:16 -07:00
Terry Jan Reedy cf27c06229
bpo-23156: Remove obsolete tix install directions (GH-11595)
Tix was deprecated in 3.6 and the doc is wrong.  New users should use ttk.
2019-01-17 19:00:51 -05:00
Slam 97e12996f3 Fixes typo in asyncio.queue doc (GH-11581)
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.
2019-01-17 03:52:17 -08:00
Nick Coghlan cee29b46a1 bpo-35486: Note Py3.6 import system API requirement change (GH-11540)
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
2019-01-17 02:41:29 -08:00
Joannah Nanjekye 92b8322e7e bpo-35674: Add os.posix_spawnp() (GH-11554)
Add a new os.posix_spawnp() function.
2019-01-16 14:29:26 +01:00
Henry Chen 06f8b57212 bpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)
Show correct number of repeats.
2019-01-15 12:29:21 +02:00
Serhiy Storchaka 32ebd8508d
bpo-29707: Document that os.path.ismount() is not able to reliable detect bind mounts. (GH-11238) 2019-01-15 10:55:40 +02:00
Alexey Izbyshev 1cffd0eed3 bpo-34512: Document platform-specific strftime() behavior for non-ASCII format strings (GH-8948) 2019-01-12 19:21:54 +02:00
Joannah Nanjekye fd7d539be3 bpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)
Document that the time.CLOCK_MONOTONIC_RAW constant
is now also available on macOS 10.12.

Co-authored-by: Ricardo Fraile <rfraile@rfraile.eu>
2019-01-11 14:19:57 +01:00
Bo Bayles bab4bbb4c9 bpo-32146: Add documentation about frozen executables on Unix (GH-5850) 2019-01-10 18:51:28 +01:00
Joannah Nanjekye 572168a016 bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503) 2019-01-10 17:56:38 +01:00
Charles-Axel Dein e394ba3214 bpo-35404: Clarify how to import _structure in email.message doc (GH-10886) 2019-01-09 15:52:10 -07:00
Pablo Galindo d6acf17c05
Add example to the documentation for calling unittest.mock.patch with create=True (GH-11056) 2019-01-09 21:43:24 +00:00
Vladimir Matveev c24c6c2c93 bpo-35568: add 'raise_signal' function (GH-11335)
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
2019-01-08 01:58:25 -08:00
Ville Skyttä 31ec52a9af bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)
https://bugs.python.org/issue35631
2019-01-04 14:14:32 +00:00
Harmandeep Singh 47a2fced84 bpo-31450: Remove documentation mentioning that subprocess's child_traceback is available with the parent process (GH-11422) 2019-01-03 11:53:56 -08:00
Harmandeep Singh e9a044ec16 bpo-35525: Correct the argument name for NNTP.starttls() (GH-11310) 2019-01-02 23:05:19 +02:00
sth 1b29c03c95 Fix typo in documentation of AbstractEventLoopPolicy.set_child_watcher() (GH-11369)
`set_child_watcher()` *sets* the watcher.
2018-12-30 14:01:28 -08:00
Cheryl Sabella c0381aaea4 bpo-28097: IDLE - Add Previous/Next History to Shell menu (#11325) 2018-12-28 15:11:30 -05:00
jab 9e00d9e88f bpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson) 2018-12-28 19:03:40 +01:00
Vaibhav Gupta 3a81076bbf bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://bugs.python.org/issue35579


https://bugs.python.org/issue35579
2018-12-26 06:47:16 -08:00
Raymond Hettinger 56edf3a4b1
Redo PR 785 -- Add cross reference links (GH-11319) 2018-12-25 17:53:36 -08:00
Mariatta 95327bc80d Minor grammar improvement in types.rst (GH-11308)
defines utility function -> defines utility functions

Reported in https://mail.python.org/pipermail/docs/2018-December/038693.html
2018-12-24 15:56:05 -08:00
Andre Delfino d83f5bda34 Fix minor grammatical mistakes in reversed(dict) doc (GH-10997) 2018-12-23 23:05:23 -08:00
Andre Delfino 7804e8c70c Tweak wording about Fraction and Decimal (GH-10904) 2018-12-23 23:03:40 -08:00
Cheryl Sabella b7105c9c96 bpo-35566: Add links to annotation glossary term (GH-11291) 2018-12-23 21:09:09 -08:00
Chris Rands d378b1f8ed bpo-34764: improve docs example of iter() with sentinel value (GH-11222) 2018-12-23 21:07:17 -08:00
Boštjan Mejak 284b787612 Add 2 missing commas (GH-10698) 2018-12-23 08:45:51 -08:00
Andre Delfino f06fba5965 Document that dict.fromkeys accepts any iterable for keys (GH-10998) 2018-12-22 20:14:46 -08:00
Serhiy Storchaka 8ac658114d
bpo-30455: Generate all token related code and docs from Grammar/Tokens. (GH-10370)
"Include/token.h", "Lib/token.py" (containing now some data moved from
"Lib/tokenize.py") and new files "Parser/token.c" (containing the code
moved from "Parser/tokenizer.c") and "Doc/library/token-list.inc" (included
in "Doc/library/token.rst") are now generated from "Grammar/Tokens" by
"Tools/scripts/generate_token.py". The script overwrites files only if
needed and can be used on the read-only sources tree.

"Lib/symbol.py" is now generated by "Tools/scripts/generate_symbol_py.py"
instead of been executable itself.

Added new make targets "regen-token" and "regen-symbol" which are now
dependencies of "regen-all".

The documentation contains now strings for operators and punctuation tokens.
2018-12-22 11:18:40 +02:00
Cheryl Sabella c1b4b0f616 bpo-22703: IDLE: Improve Code Context and Zoom Height menu labels (GH-11214)
The Code Context menu label now toggles between Show/Hide Code Context. 
 The Zoom Height menu now toggles between Zoom/Restore Height. 
 Zoom Height has moved from the Window menu to the Options menu. 

 
https://bugs.python.org/issue22703
2018-12-21 22:25:45 -08:00
Xtreak f0af4c54e3 bpo-33830: Fix an example in http.client docs for 404. (GH-7780) 2018-12-21 17:34:41 +02:00
Terry Jan Reedy 292cd6e331
bpo-35521: Add more cross-refs to IDLE docs (#11257)
Format menu and preferences.
2018-12-20 06:06:29 -05:00
Cheryl Sabella 01421bec1e bpo-35521: IDLE: Add code context section to docs (#11205)
Also add some internal cross-references.
2018-12-20 00:38:54 -05:00
Serhiy Storchaka bf99bcf56c
Fix Python version since which external enities are not resolved by default. (GH-11237) 2018-12-19 15:29:04 +02:00
Manjusaka 92330c0b6d bpo-35497: add versionadded tag for EPOLLEXCLUSIVE (GH-11162) 2018-12-19 19:59:52 +08:00
Serhiy Storchaka 2b57c43f21
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174) 2018-12-19 08:09:46 +02:00
Jules Lasne (jlasne) 82d73554e4 Removed dangling `since Python` at the end of library/xml.rst. (GH-11201) 2018-12-19 08:05:14 +02:00
Hrvoje Nikšić e3666fc8ef bpo-35465: Document _UnixSelectorEventLoop.add_signal_handler. (GH-11145) 2018-12-18 16:31:29 -05:00
Victor Stinner 3ab064e80a
bpo-23451: Update time.monotonic() documentation (GH-11190)
bpo-23451, bpo-22117: Python 3.5 requires Windows Vista or newer,
time.monotonic() is now always system-wide.
2018-12-17 12:12:34 +01:00
Beomsoo Kim b912f9342e bpo-35511: Trivial docs updates for profile and resource library modules. (GH-11124)
polish documentation for profile and resource modules
2018-12-16 21:34:08 +02:00
Victor Stinner d7538dd5e3
bpo-35471: Remove the macpath module (GH-11129)
Python 2.4 dropped MacOS 9 support. The macpath module was deprecated
in Python 3.7. This change removes it.
2018-12-14 13:37:26 +01:00
Victor Stinner 7acd50ad8b
bpo-35491: Enhance multiprocessing.BaseProcess.__repr__() (GH-11138)
* Add the pid and parent pid to multiprocessing.BaseProcess.__repr__().
* Add negative sign (ex: "-SIGTERM") to exitcode (process killed
  by a signal)
* Only call _popen.poll() once.

Example:
  <ForkProcess(ForkPoolWorker-1, started daemon)>
becomes:
  <ForkProcess name='ForkPoolWorker-1' pid=12449 parent=12448 started daemon>

Example:
  <ForkProcess(ForkPoolWorker-1, stopped[SIGTERM] daemon)>
becomes:
  <ForkProcess name='ForkPoolWorker-1' pid=12960 parent=12959 stopped exitcode=-SIGTERM daemon>
2018-12-14 12:58:52 +01:00
Jules Lasne (jlasne) cb0f5e29e3 Fixed missing colun in library/sys.po (GH-11153)
# Fixed missing colun in library/sys.po


[bpo-35492](https://bugs.python.org/issue35492): Fixed missing colun in library/sys.po
2018-12-14 03:28:44 -08:00
Xiang Zhang 4fb0b8bc25
bpo-33106: change dbm key deletion error for readonly file from KeyError to dbm.error (#6295) 2018-12-12 20:46:55 +08:00
Steve Dower 1c3de541e6
bpo-34977: Use venv redirector instead of original python.exe on Windows (GH-11029) 2018-12-10 08:11:21 -08:00
Gregory P. Smith e328753d91
bpo-22005: Document the reality of pickle compatibility. (GH-11054) 2018-12-09 11:42:58 -08:00
Andre Delfino de9e9b476e Fix numbered lists in stdtypes.rst. (GH-10989) 2018-12-09 09:00:20 +02:00
Serhiy Storchaka 8452ca15f4
bpo-22005: Fixed unpickling instances of datetime classes pickled by Python 2. (GH-11017)
encoding='latin1' should be used for successful decoding.
2018-12-07 13:42:10 +02:00
Gregory P. Smith 91f259b478
Clarify expectedFailure in the unittest docs. (#10953) 2018-12-06 12:56:24 -08:00
E Kawashima 2d8f976cde Fix typo in xml.dom.minidom documentation (GH-10956)
Escape the \t and \n.
Follow up from https://github.com/python/cpython/pull/10814.
2018-12-05 14:15:42 -08:00
Victor Stinner ea0ca218b0
bpo-35344: platform.platform() uses mac_ver() on macOS (GH-10780)
On macOS, platform.platform() now uses mac_ver(), if it returns a
non-empty release string, to get the macOS version rather than darwin
version.
2018-12-05 22:41:52 +01:00
Matt Wheeler 40a61da40d Fix typos in concurrent.Futures documentation (GH-10920)
Add a missing word `as` in `as well as an`.
Linkify `threading.Thread`.
2018-12-05 13:41:20 -08:00
Andre Delfino 55f41e45b4 Correct a couple of unbalanced parenthesis. (GH-10779) 2018-12-05 21:45:30 +02:00
Naglis 1747334794 bpo-35395: fix typos in asyncio eventloop documentation (GH-10880)
Fixes `loop.add_writer` and `loop.add_signal_handler` method documentation to correctly reference the callback parameter from method signature.


https://bugs.python.org/issue35395
2018-12-03 23:31:15 -08:00
Chris Withers 8ca0fa9d2f
bpo-35226: Fix equality for nested unittest.mock.call objects. (#10555)
Also refactor the call recording imolementation and add some notes
about its limitations.
2018-12-03 21:31:37 +00:00
Ismo Toijala 68b56d02ef bpo-35341: Add generic version of OrderedDict to typing (GH-10850) 2018-12-02 15:53:14 +00:00
E Kawashima b7c2182604 Fix signature of xml.dom.minidom.Document.toprettyxml(). (GH-10814) 2018-11-30 16:03:00 +02:00
Victor Stinner 73104fa1e6
bpo-35345: Remove platform.popen() (GH-10781)
Remove platform.popen() function, it was deprecated since Python 3.3:
use os.popen() instead.

Rename also the "Removed" section to "API and Feature Removals"
of What's New in Python 3.8.
2018-11-29 09:58:20 +01:00
Lisa Roach 433433fa6d
Adds IPv6 support when invoking http.server directly. (GH-10595) 2018-11-26 10:43:38 -08:00
Raymond Hettinger f0e0f2008d bpo-35300: Add usage note to the lru_cache() docs (GH-10707)
https://bugs.python.org/issue35300
2018-11-25 16:24:52 -08:00
Serhiy Storchaka 4bb186d7e2
bpo-32035: Fix words about strings and bytes in zipfile documentation. (GH-10592) 2018-11-25 09:51:14 +02:00
takey ba57963a95 Linkify SMTP.quit() in smtplib documentation. (GH-9785) 2018-11-23 08:53:24 -08:00
Zhiming Wang 361e8683e7 bpo-35035: Rename email.utils documentation to email.utils.rst (GH-10023)
I'll watch for 404 on the old URL and will setup an HTTP redirection if needed.
2018-11-21 13:41:07 +01:00
Serhiy Storchaka 6c48bf2d9e
bpo-9842: Add references for using "..." as a placeholder to the index. (GH-10330) 2018-11-20 19:26:09 +02:00
Victor Stinner 02e6bf7f20
bpo-28604: Fix localeconv() for different LC_MONETARY (GH-10606)
locale.localeconv() now sets temporarily the LC_CTYPE locale to the
LC_MONETARY locale if the two locales are different and monetary
strings are non-ASCII. This temporary change affects other threads.

Changes:

* locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode
  monetary fields.
* Add LocaleInfo.grouping_buffer: copy localeconv() grouping string
  since it can be replaced anytime if a different thread calls
  localeconv().
* _Py_GetLocaleconvNumeric() now requires a "struct lconv *"
  structure, so locale.localeconv() now longer calls localeconv()
  twice. Moreover, the function now requires all arguments to be
  non-NULL.
* Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT.
* Move _Py_GetLocaleconvNumeric() definition from fileutils.h
  to pycore_fileutils.h. pycore_fileutils.h now includes locale.h.
* The _locale module is now built with Py_BUILD_CORE defined.
2018-11-20 16:20:16 +01:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) 4edeaeac4c bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565) 2018-11-16 15:28:51 +02:00
Terry Jan Reedy b65413b497
bpo-35213: Where appropriate, use 'macOS' in idlelib. (#10478) 2018-11-15 13:15:13 -05:00
Andrés Delfino 8e0b05e2f4 Grammar corrections in abc.rst (GH-10525) 2018-11-13 16:40:44 -08:00
Andrés Delfino bf1355b424 Link to property built-in in abc.rst (GH-10526) 2018-11-13 16:29:57 -08:00
l-n-s daeb3c4c58 Fix doc typo: Window -> Windows (GH-10508) 2018-11-13 16:13:12 -08:00
Andrés Delfino 7610f4fe93 Correct grammar mistake in stdtypes.rst (GH-10481) 2018-11-12 09:24:00 -08:00
Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) cd449806fa Minor grammar improvement to io documentation. (GH-10329)
Independently of -> Independent of
2018-11-11 20:06:18 -08:00
Jakub Stasiak 7432f0929f Update subprocess.Popen documentation wrt universal_newlines arg (GH-10337)
* universal_newlines defaulting to False would suggest, that not
  specifying universal_newlines explicitly and setting text to True
  should cause an error, which is not the case.
* The run function didn't have the universal_newlines parameter
  documented
* The check_output function didn't have its text parameter documented
2018-11-11 19:40:42 -08:00
Andrés Delfino 76e8fd7b7e dict insertion order is guaranteed since 3.7 (GH-10431) 2018-11-11 08:56:47 -08:00
Terry Jan Reedy 50ff02b431
bpo-34864: Document two IDLE on MacOS issues. (GH-10456)
The System Preferences Dock "prefer tabs always" setting disables some
IDLE features.  Menus are a bit different than as described for Windows
and Linux.
2018-11-10 23:26:31 -05:00
Géry Ogam 009b2f0204 Correct a typo in the Unittest documentation (GH-10397)
Co-Authored-By: maggyero <gery.ogam@gmail.com>
2018-11-09 14:34:54 -05:00
Raymond Hettinger b83942c755 Cleanup and improve the regex tokenizer example. (GH-10426)
1) Convert weird field name "typ" to the more standard "type".
2) For the NUMBER type, convert the value to an int() or float().
3) Simplify ``group(kind)`` to the shorter and faster ``group()`` call.
4) Simplify logic go a single if-elif chain to make this easier to extend.
5) Reorder the tests to match the order the tokens are specified.
   This isn't necessary for correctness but does make the example
   easier to follow.
6) Move the "column" calculation before the if-elif chain so that
   users have the option of using this value in error messages.
2018-11-09 01:19:33 -08:00
Lisa Roach 0f221d09ca
bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) 2018-11-08 18:34:33 -08:00
Andrés Delfino ae31e3fbf4 glob uses fnmatch.filter instead of fnmatch since 2001. (GH-10102) 2018-11-07 20:09:11 +02:00
Andrés Delfino d64991031e Correct grammar mistakes in string.rst. (GH-9752) 2018-11-07 19:24:56 +02:00
Andrés Delfino ca03f3b93e Mark len call as a code snippet in stdtypes.rst. (GH-9804) 2018-11-07 19:22:47 +02:00
Cheryl Sabella 637a33b996 bpo-2504: Add pgettext() and variants to gettext. (GH-7253) 2018-11-07 16:12:20 +02:00
Diego Rojas 5598cc90c7 bpo-34160: Preserve order of attributes in minidom. (GH-10219) 2018-11-07 16:09:04 +02:00
HongWeipeng f194479949 bpo-31553: add --json-lines option to json.tool (#10051)
* add jsonlines option to json.tool

* code review

* fix:avoid read infile after it close

* improve doc in whatsnew 3.8
2018-11-07 12:09:32 +02:00
guoci 0e7497cb46 bpo-34898: Add mtime parameter to gzip.compress(). (GH-9704)
Without setting mtime, time.time() will be used as the timestamp which will
end up in the compressed data and each invocation of the compress() function
will vary over time.
2018-11-07 11:50:23 +02:00
Andrés Delfino d2b11af915 Remove duplicate "Reference Guide" in optparse.rst. (GH-10372) 2018-11-07 07:47:11 +02:00
Terry Jan Reedy 76cd0c30d6
bpo-33000: Document that IDLE's shell has no line limit. (#10373)
A program that runs indefinitely can overfill memory.
2018-11-06 23:55:06 -05:00
Terry Jan Reedy 75d9d59ab3
bpo-23220: Explain how IDLE's Shell displays output (GH-10356)
Add a new subsection to the doc.
2018-11-06 12:37:36 -05:00
Terry Jan Reedy 5e79090324
bpo-35099: Improve the doc about IDLE running user code. (#10350)
The section is renamed from "IDLE -- console differences".  It mostly
covers the implications of using custom sys.stdxxx objects.
2018-11-05 21:30:32 -05:00
Rémi Lapeyre 6531bf6309 bpo-33462: Add __reversed__ to dict and dict views (GH-6827) 2018-11-06 09:38:54 +09:00
E Kawashima 16c8a53490 [Docs] Fix required version of an example of importlib (GH-10118)
§31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5.
2018-11-05 23:41:17 +01:00
Serhiy Storchaka 083a7a172b
bpo-35167: Specify program for gzip and json.tool command line options. (GH-10332) 2018-11-05 17:47:27 +02:00
Mario Corchero ad1a25f499 bpo-32512: Add -m option to profile for profiling modules (#5132)
The new option in the CLI of the profile module allow to profile
executable modules. This change follows the same implementation as the
one already present in `cProfile`.

As the argument is now present on both modules, move the tests to the
common test case to be run with profile as well.
2018-11-05 22:03:46 +10:00
Max Bélanger 2810dd7be9 closes bpo-32285: Add unicodedata.is_normalized. (GH-4806) 2018-11-04 15:58:24 -08:00
Windson yang 98b8535415 bpo-35118: Improve docs regarding indexing (GH-10265) 2018-11-04 14:34:22 -08:00
Stéphane Wirtel 55f3317e98 bpo-10536: Enhancements to gettext docs (GH-10324) 2018-11-04 23:24:41 +01:00
Saptak Sengupta 622935d9a6 bpo-31887: Adds documentations for special multipart/signed handling (GH-4268)
This pull request adds some information about the special multipart/signed handling to clear about disabling header folding.


https://bugs.python.org/issue31887
2018-11-04 14:12:34 -08:00
Elena Oat 52465e1b8b Explain that the orderness of the result of glob is system-dependant (GH-6587)
Thanks!
2018-11-04 15:50:55 +01:00
Stéphane Wirtel 3e28eed9ec bpo-34969: Add --fast, --best on the gzip CLI (GH-9833) 2018-11-03 16:24:23 +01:00
Pablo Galindo bf46a09dec bpo-35075: Fix broken url in the pprint documentation (GH-10201)
https://bugs.python.org/issue35075
2018-11-01 05:29:38 -07:00
Serhiy Storchaka 511747bec3
bpo-35110: Fix yet few spaces before dashes. (GH-10255) 2018-10-31 11:14:38 +02:00
Serhiy Storchaka 3f819ca138
bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) 2018-10-31 02:26:06 +02:00
matthewbelisle-wf 68f323715e bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10247) 2018-10-30 21:30:19 +01:00
Daniel Lovell a80af77087 bpo-35086: Fix tkinter example "A Simple Hello World Program". (GH-10160)
The root widget was accessed as a global variable in the Application's method.
2018-10-30 16:56:07 +02:00
Serhiy Storchaka b232df9197
bpo-31680: Add curses.ncurses_version. (GH-4217)
Use curses.ncurses_version for conditionally skipping a test.
2018-10-30 13:22:42 +02:00
Andriy Maletsky b83d917faf Doc: fix asyncio loop.close() description (GH-10229)
Needs backport to 3.7. In 3.6 the description is correct.
2018-10-29 14:39:21 -07:00
Stephan Hoyer 0200928e8d Include memo in the documented signature of copy.deepcopy()
* Include memo in the documented signature of copy.deepcopy()

The memo argument is mentioned lower on the doc page under writing a
`__deepcopy__` method, but is not included in the documented function signature.
This makes it easy to miss, and can lead to incorrect/buggy implementations of
`__deepcopy__` -- which is exatly what just happpend to me!
2018-10-29 12:30:12 -06:00
Gus Goulart c0799ec973 bpo-27741: Better wording for datetime.strptime() (GH-9994) 2018-10-29 12:49:52 +01:00
Terry Jan Reedy ea9c8bd443
bpo-35097: Add IDLE doc subsection explaining editor windows. (#10206)
Topics include opening, title and status bar, .py* extension, and running.
2018-10-28 20:42:18 -04:00
Terry Jan Reedy 18032632ab
Issue 35093: Document the IDLE document viewer in the IDLE doc. (#10195)
Add a paragraph in "Help and preferences", "Help sources" subsection.
2018-10-28 16:21:18 -04:00
Raymond Hettinger e3685fd5fd
bpo-34160: Preserve user specified order of Element attributes (GH-10163) 2018-10-28 11:18:22 -07:00
Terry Jan Reedy 68d6dc0770
bpo-1529353: Explain Shell text squeezing in the IDLE doc. (#10169) 2018-10-28 12:44:44 -04:00
Sebastian Rittau c8a8d6b347 bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://bugs.python.org/issue35089
2018-10-28 16:03:29 +00:00
Serhiy Storchaka 913876d824
bpo-35054: Add yet more index entries for symbols. (GH-10121) 2018-10-28 13:41:26 +02:00
Andreas Pelme d855f2fdbd unittest documentation: Spell pytest without the dot (GH-9820)
Referring to ``pytest`` as ``py.test`` is deprecated.
2018-10-27 11:09:12 -07:00
nsrip 40bf6cff22 Fix typo in zipfile documentation. (GH-10151) 2018-10-27 17:42:56 +03:00
Serhiy Storchaka fec35c99aa
bpo-33710: Deprecate l*gettext() and related functions in the gettext module. (GH-10139)
They return encoded bytes and are Python 2 artifacts.
2018-10-27 08:00:41 +03:00
Terry Jan Reedy d9bff4e81b
bpo-35079: Revise difflib.SequenceManager.get_matching_blocks doc (GH-10144)
Specify that blocks are non-overlapping. Change '!=' to '<'.
2018-10-26 23:03:08 -04:00
Stéphane Wirtel 12e696b4f0 bpo-35042: Use the :pep: role where a PEP is specified (#10036) 2018-10-26 15:58:26 -07:00
Benjamin Peterson 4e3a53bcee
Fix a typo in asyncio-dev.rst. (GH-10133)
"threadsafe"
2018-10-26 10:14:04 -07:00
Andrés Delfino a6dc531063 bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576) 2018-10-26 17:56:57 +03:00
Senthil Kumaran 25a525bf5a
Simplify the warning for http.server. (#10116) 2018-10-26 06:43:37 -07:00
Pablo Galindo 7cd2543416
bpo-34890: Make iscoroutinefunction, isgeneratorfunction and isasyncgenfunction work with functools.partial (GH-9903)
inspect.isfunction() processes both inspect.isfunction(func) and
inspect.isfunction(partial(func, arg)) correctly but some other functions in the
inspect module (iscoroutinefunction, isgeneratorfunction and isasyncgenfunction)
lack this functionality. This commits adds a new check in the mentioned functions
in the inspect module so they can work correctly with arbitrarily nested partial
functions.
2018-10-26 12:19:14 +01:00
Stéphane Wirtel e483f02423 bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037) 2018-10-26 12:52:11 +02:00
Serhiy Storchaka ddb961d2ab
bpo-35054: Add more index entries for symbols. (GH-10064) 2018-10-26 09:00:49 +03:00
Max Bélanger 6c83d9f4a7 bpo-35022: unittest.mock.MagicMock now also supports __fspath__ (GH-9960)
The MagicMock class supports many magic methods, but not __fspath__. To ease
testing with modules such as os.path, this function is now supported by default.
2018-10-25 23:48:58 +02:00
Stéphane Wirtel 1770d1c512 bpo-35038: AttributeError: 'frame' object has no attribute 'f_restricted'. (GH-10098)
https://bugs.python.org/issue35038
2018-10-25 14:13:45 -07:00
Ned Batchelder 890423f796 configparser doc: Properly label ConfigParser attributes (GH-9930) 2018-10-25 01:47:01 +02:00
orlnub123 78401f7156 importlib doc: Fix approximated import_module() code (GH-9945)
The spec gets stored on modules with the __spec__ attribute, not spec.
2018-10-25 01:32:26 +02:00
Mariatta 9f43fbbd9d Use f-strings in asyncio-task code examples (GH-10035)
Replace str.format with f-strings in the code examples of asyncio-task documentation.
2018-10-25 00:37:12 +02:00
jdemeyer 057f4078b0 bpo-32797: improve documentation of linecache.getline (GH-9540) 2018-10-24 14:44:41 +02:00
Zsolt Cserna 4f399be0e7 bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523)
Fix the documentation of copy2, as it does not copy file ownership (user and
group), only mode, mtime, atime and flags.

The original text was confusing to developers as it suggested that this
command is the same as 'cp -p', but according to cp(1), '-p' copies file
ownership as well.

Clarify which metadata is copied by shutil.copystat in its docstring.
2018-10-23 12:09:50 +02:00
Andrei Petre 83a07652e0 bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) 2018-10-23 14:11:20 +08:00
Xtreak 890a4b9293 bpo-35020: Link to sorting examples from list.sort() (GH-9931) 2018-10-20 14:39:03 -07:00
Senthil Kumaran eeab510bb7
bpo-34576 - Fix the formatting for security considerations in http.server.rst (#10005)
* bpo-34576 - Fix the formatting for security considerations in http.server.rst

* Address review comment.
2018-10-20 11:32:07 -07:00
Stéphane Wirtel 0522fd81dc bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736) 2018-10-20 10:43:32 +02:00
Pablo Galindo d5b4f1b5a0
bpo-34983: Expose symtable.Symbol.is_nonlocal() in the symtable module (GH-9872)
The symbol table was not exposing functionality to query the nonlocal symbols
in a function or to check if a particular symbol is nonlocal.
2018-10-20 01:46:00 +01:00
Pablo Galindo 027664a3d5 bpo-32798: Add restriction on the offset parameter for mmap.flush in the docs (#5621)
Add restriction on the offset parameter for mmap.flush.

Explain that ALLOCATIONGRANULARITY is the same as PAGESIZE in Unix.
2018-10-20 02:37:55 +02:00
Alexey Izbyshev a2670565d8 bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842)
If buffering=1 is specified for open() in binary mode, it is silently
treated as buffering=-1 (i.e., the default buffer size).
Coupled with the fact that line buffering is always supported in Python 2,
such behavior caused several issues (e.g., bpo-10344, bpo-21332).

Warn that line buffering is not supported if open() is called with
binary mode and buffering=1.
2018-10-20 02:22:31 +02:00
Julien Palard acef69068f queue doc: Clarify that the simple FIFO queue is SimpleQueue (GH-8372) 2018-10-20 00:27:49 +02:00
Mario Corchero 96200eb2ff unittest.mock doc: Fix references to recursive seal of Mocks (GH-9028)
The docs in `library/unittest.mock` have been updated to remove
confusing terms about submock and be explicit about the behavior
expected.
2018-10-19 23:57:37 +02:00
Sergey Fedoseev b981fec8d6 Use dict unpacking in functools.partial() docs (GH-9412) 2018-10-19 23:42:07 +02:00
Braden Groom 5be00247ae bpo-26441: Remove documentation for deleted to_splittable and from_splittable methods (#9865) 2018-10-18 20:13:23 -04:00
Vinay Sajip bbd90e4f62
Updated documentation on logging.debug(). (GH-9946) 2018-10-18 11:45:58 +01:00
Cheryl Sabella 0f11a88622 Add missing comma to wsgiref doc (GH-9932) 2018-10-17 22:55:32 +01:00
Julien Palard 8e73ad38ab
Doc: Fix is_prime (GH-9909) 2018-10-17 08:45:51 +02:00
Cheryl Sabella c984d20ec8 In email docs, correct spelling of foregoing (#9856) 2018-10-16 15:28:34 -04:00
Cheryl Sabella a5ca98537b In email.parser in message_from_bytes, update `strict` to `policy` (#9854)
According to the versionchanged note, the `strict` argument was removed in 3.3 and `policy` was added, but the name of the argument in the paragraph wasn't updated.
2018-10-16 15:26:17 -04:00
Braden Groom 43a5bd7b45 bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (GH-9859) 2018-10-15 17:39:16 -04:00
Wolfgang Maier 6bdb6f7675 fix dangling keyfunc examples in documentation of heapq and sorted (#1432)
* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
2018-10-15 13:06:53 -06:00
BNMetrics 18fb1fb943 bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter (GH-9703) 2018-10-15 19:41:36 +01:00
Zackery Spytz 0461704060 bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue is closed. (GH-9010)
Previously, put() and get() would raise AssertionError and OSError,
respectively.
2018-10-13 12:26:09 +03:00
Cheryl Sabella 2d6097d027 bpo-11233: Create availability directive for documentation (GH-9692)
Replace "Availability: xxx" with ".. availability:: xxx" in the doc.
Original patch by Georg Brandl.

Co-Authored-By: Georg Brandl <georg@python.org>
2018-10-12 16:55:20 +02:00
Stéphane Wirtel 859c068e52 bpo-34962: make doctest in Doc/ now passes, and is enforced in CI (GH-9806) 2018-10-12 09:51:05 +02:00
Felipe Rodrigues 1d26c72e6a bpo-34576 warn users on security for http.server (#9720)
It was proposed to add an warning for http.server regarding security
issues. The wording was provided at bpo-26005 by @orsenthil
2018-10-10 19:43:40 -07:00
Elvis Pranskevichus a6b3ec5b6d bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in
3.7.0 in bpo-29708.  The change is bad, as it unconditionally overrides
*invalidation_mode*, even if it was passed as an explicit argument to
``py_compile.compile()`` or ``compileall``.  An environment variable
should *never* override an explicit argument to a library function.
That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH``
environment variable is set.

This changes ``py_compile.compile()`` to only look at
``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified.
I also made various relevant tests run with explicit control over the
value of ``SOURCE_DATE_EPOCH``.

While looking at this, I noticed that ``zipimport`` does not work
with hash-based .pycs _at all_, though I left the fixes for
subsequent commits.
2018-10-10 18:43:14 +02:00
Mayank Asthana 7e18deef65 bpo-34926: Make mimetypes.guess_type accept os.PathLike objects (GH-9777)
:meth:`mimetypes.MimeTypes.guess_type` now accepts :term:`path-like object` in addition to url strings.
2018-10-10 16:46:44 +02:00
Stéphane Wirtel 7c817e620b bpo-34913: Document gzip command line interface (GH-9782) 2018-10-10 08:28:26 +02:00
Paul Bailey 4c33997057 bpo-34911: Added support for secure websocket cookies (GH-9734) 2018-10-08 21:49:29 +03:00
Xtreak a8d5e2f255 Use double quote instead of backtick to clarify Ellipsis constant (GH-9754) 2018-10-08 20:44:16 +05:30
Sanyam Khurana ffc5a14d00 bpo-33014: Clarify str.isidentifier docstring (GH-6088)
* bpo-33014: Clarify str.isidentifier docstring

* bpo-33014: Add code example in isidentifier documentation
2018-10-08 12:23:32 +05:30
Danish Prakash 656d52dbfd bpo-34901: add isolated (-I) flag to sys.flags (GH-9708)
https://bugs.python.org/issue34901
2018-10-07 09:12:31 -07:00
Andrés Delfino 7dfbd49671 Correct grammar mistake in re.rst. (GH-9745) 2018-10-06 22:48:30 +03:00
Christophe Nanteuil 92878829c3 bpo-34158: Documentation UTC offset update (GH-8377)
* Documentation of UTC offset update
Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update:

- "%z" format code documentation update
Karthikeyan Singaravelan commented on bugs.python.org:
Added as part of 018d353c1c and a fix regarding duplicate words for that part was added at bac2d5ba30.
Relevant format string at https://github.com/python/cpython/pull/2896/files#diff-25e2d173c84057d069b7890450714eddR214.
Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/files#diff-acc40bec51c7de832de3361db3edae52R309.
Table at https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column
%z | UTC offset in the form ±HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030

- isoformat documentation update
According to me, needs confirmation:
Relevant format string at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714eddR176
Relevant test case at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714edd

* From Martin Panter: some style improvment;
From @pganssle: using f for fractional part of seconds in all file.
2018-10-05 18:57:02 -04:00
Xtreak 6f9c55d1c0 bpo-34825: Add more entries to os to pathlib reference table (GH-9608)
The added functions are as below :

| os module     | Pathlib       |
| ------------- | ------------- |
| os.chmod   | Path.chmod  |
| os.mkdir  | Path.mkdir  | 
| os.rename | Path.rename |
| os.replace | Path.replace |
| os.rmdir  | Path.rmdir |
| os.remove, os.unlink | Path.unlink |
| os.path.samefile | Path.samefile |

Thanks


https://bugs.python.org/issue34825
2018-10-05 08:24:11 -07:00
Stéphane Wirtel 07fbbfde1b bpo-34906: Doc: Fix typos (GH-9712) 2018-10-05 16:17:18 +02:00
Benjamin Peterson e006b39a40
Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680)
A follow up to be4e5b8920.
2018-10-02 21:38:39 -07:00
Benjamin Peterson be4e5b8920
Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670) 2018-10-01 22:18:44 -07:00
Ezio Melotti 30534cc717
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662) 2018-10-01 17:34:46 -07:00
Hrvoje Nikšić cd602b8af2 bpo-34476: Document that asyncio.sleep() always suspends. (#9643) 2018-10-01 13:09:38 +03:00
Brendan Jurd 9df100286b Fix name of argument in docs for functools.reduce(). (#9634) 2018-09-30 23:52:10 -07:00
Zackery Spytz e45473e3ca bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Switch "list" with "iterable" to match with the implementation.
2018-09-29 10:15:55 -06:00
Zackery Spytz eef059657d bpo-31370: Remove references to threadless builds (#8805)
Support for threadless builds was removed in a6a4dc81.
2018-09-29 10:07:11 -06:00
방성범 (Bang Seongbeom) 508d820512 Fix astuple in dataclasses documentation (GH-9631) 2018-09-29 06:50:31 -04:00
Victor Stinner 37aae9dcf1 bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)
Since ProactorEventLoop is now the default in 3.8, remove examples
using it explicitly on Windows.





https://bugs.python.org/issue34687
2018-09-28 08:40:08 -07:00
Yury Selivanov 59ee5b1293
bpo-34802: Fix asyncio.iscoroutine() docs (GH-9611) 2018-09-27 15:48:30 -04:00
Serhiy Storchaka 3f22811fef
bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445) 2018-09-27 17:42:37 +03:00
Tal Einat f55c64c632
bpo-31425: fix versionadded in docs and add attribution in NEWS (GH-9595) 2018-09-27 00:20:38 +03:00
Michael Lee 130717fe58 Clarify that Type[SomeTypeVar] is legal (#9585)
Currently, the docs state that when doing `Type[X]`, X is only allowed to
be a class, a union of classes, and Any. This pull request amends
that sentence to clarify X may also be a typevar (or a union involving
classes, Any, and TypeVars).
2018-09-26 16:13:28 +01:00
Bjorn Andersson bb8165172a bpo-31425: Expose AF_QIPCRTR in socket module (GH-3706)
The AF_QIPCRTR address family was introduced in Linux v4.7.

Co-authored-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2018-09-26 16:47:52 +03:00
Cheryl Sabella d345bb4d9b bpo-34334: Don't log traceback twice in QueueHandler (GH-9537) 2018-09-26 00:00:08 +01:00
Yury Selivanov fad6af2744
asyncio/docs: Replace Python 4.0 -> 3.10 (GH-9579) 2018-09-25 17:44:52 -04:00
Zackery Spytz 5a5ce064b3 bpo-5950: Support reading zips with comments in zipimport (#9548)
* bpo-5950: Support reading zips with comments in zipimport
2018-09-25 15:15:47 -04:00
Yury Selivanov 996859a90d
bpo-34790: [docs] Passing coroutines to asyncio.wait() can be confusing. (GH-9543) 2018-09-25 14:51:21 -04:00
Victor Stinner 6ea29c5e90 bpo-34687: Make asynico use ProactorEventLoop by default (GH-9538) 2018-09-25 11:27:08 -04:00
Joe Pamer c8c0249c9e bpo-32557: allow shutil.disk_usage to take a file path on Windows also (GH-9372)
https://bugs.python.org/issue32557
2018-09-25 07:57:36 -07:00
Joni Kähärä b60b4683f6 Fix wrong exception reference: BrokenThreadPool -> BrokenProcessPool (GH-9533) 2018-09-25 11:30:25 +08:00
Lisa Roach 9718b59ee5
bpo-34659: Adds initial kwarg to itertools.accumulate() (GH-9345) 2018-09-23 17:34:59 -07:00
Christian Heimes 17b1d5d4e3 bpo-17239: Disable external entities in SAX parser (GH-9217)
The SAX parser no longer processes general external entities by default
to increase security. Before, the parser created network connections
to fetch remote files or loaded local files from the file system for DTD
and entities.

Signed-off-by: Christian Heimes <christian@python.org>



https://bugs.python.org/issue17239
2018-09-23 00:50:25 -07:00
Christian Heimes 9fb051f032 bpo-34670: Add TLS 1.3 post handshake auth (GH-9460)
Add SSLContext.post_handshake_auth and
SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake
authentication.

Signed-off-by: Christian Heimes <christian@python.org>q


https://bugs.python.org/issue34670
2018-09-22 23:32:31 -07:00
Ethan Furman 5bdab641da
bpo-29577: Enum: mixin classes don't mix well with already mixed Enums (GH-9328)
* bpo-29577: allow multiple mixin classes
2018-09-21 19:03:09 -07:00
Yury Selivanov db1a80e97a
bpo-33649: Fix gather() docs; fix title; few other nits. (GH-9475) 2018-09-21 16:23:15 -04:00
Xiang Zhang 7d161726e4 Make docs of exitcode for subprocess.getstatusoutput more clear. (GH-9477)
Make it more accurate and not limited to UNIX.
2018-09-21 13:18:20 -07:00
Yury Selivanov e247b46cba
bpo-33649: More improvements (GH-9439) 2018-09-20 12:43:59 -04:00
Yury Selivanov ffef50f1f5
bpo-34746: Fix stop -> close (GH-9437) 2018-09-20 01:17:09 -04:00
Yury Selivanov 471503954a
bpo-33649: Add a high-level section about Futures; few quick fixes (GH-9403)
Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-09-18 17:55:44 -04:00
Nathaniel J. Smith a3c88ef12c Clarify that AsyncExitStack works with coroutine functions (GH-9405)
The docs were ambiguous about whether you pass in a coroutine function
or a coroutine object, e.g. is it:

  aestack.push_async_exit(some_async_func)

or

  aestack.push_async_exit(some_async_func())

(It's the first one.)
2018-09-18 14:27:59 -07:00
Serhiy Storchaka 0185f34ddc
bpo-33721: Make some os.path functions and pathlib.Path methods be tolerant to invalid paths. (#7695)
Such functions as os.path.exists(), os.path.lexists(), os.path.isdir(),
os.path.isfile(), os.path.islink(), and os.path.ismount() now return False
instead of raising ValueError or its subclasses UnicodeEncodeError
and UnicodeDecodeError for paths that contain characters or bytes
unrepresentative at the OS level.
2018-09-18 11:28:51 +03:00
Serhiy Storchaka 7bdf28265a
bpo-32455: Add jump parameter to dis.stack_effect(). (GH-6610)
Add C API function PyCompile_OpcodeStackEffectWithJump().
2018-09-18 09:54:26 +03:00
Yury Selivanov b042cf10c6
bpo-33649: Fix markup; add another note that asyncio.run is 3.7+ (GH-9389) 2018-09-18 02:47:54 -04:00
Miguel Ángel García 9c53fa6ad9 Fix syntax error on Asyncio example in doc (GH-9387)
The `gather` method requires to close the parenthesis, but it is being closed twice.
2018-09-18 02:01:26 -04:00
Danny Hermes 7bfbda46f4 Change "set_after" reference to `say_after`. (GH-9384) 2018-09-18 00:49:21 -04:00
Yury Selivanov ac94e38d07
bpo-33649: Note that asyncio.run() calls shutdown_asyncgens() (GH-9380) 2018-09-17 23:58:00 -04:00
Elvis Pranskevichus 1fa2ec49be bpo-33649: A copy-editing pass on asyncio documentation (GH-9376) 2018-09-17 19:16:44 -04:00
Yury Selivanov 3085534c39
bpo-33649: Add a hello world example to asyncio.rst (GH-9374) 2018-09-17 18:41:59 -04:00
Yury Selivanov c62ab2862d
bpo-34717: Stop numbering stdlib titles/sections in the docs (GH-9370) 2018-09-17 18:12:21 -04:00
Yury Selivanov 394374e30c
bpo-33649: Add low-level APIs index. (GH-9364) 2018-09-17 15:35:24 -04:00
Serhiy Storchaka 5e99b56d6b
bpo-33216: Improve the documentation for CALL_FUNCTION_* (GH-8338) (GH-8784) 2018-09-17 15:15:03 +03:00
Bumsik Kim 5cc583d940 bpo-33649: Clarify protocol_factory as a method parameter (GH-9330) 2018-09-16 16:40:44 -07:00
Yury Selivanov 805e27eff6
bpo-33649: Fix asyncio-dev (GH-9324) 2018-09-14 16:57:11 -07:00
Yury Selivanov 7372c3bbef
bpo-33649: Add high-level APIs cheat-sheet (GH-9319) 2018-09-14 15:11:24 -07:00
Yury Selivanov 6c7316439d
bpo-33649: Refresh asyncio docs landing page (GH-9322) 2018-09-14 14:57:39 -07:00
Grant 5acccfaf68 Grammar fix (GH-9318) 2018-09-14 14:37:48 -07:00
Yury Selivanov 3faaa8857a bpo-33649: Refresh Tasks and Futures pages (#9314)
* bpo-33649: Refresh Tasks and Futures pages

* Fixes

* Fix markup
2018-09-14 13:32:07 -07:00
Andrés Delfino 271818fe27 Fix "Python" casing in a few places (GH-9001) 2018-09-14 10:13:09 -07:00
Carol Willing c9d66f0ed4
bpo-33649 Polish asyncio docs on queues, protocols, and subproccesses (#9306)
* small clarification

* edits to protocols doc

* Edit async queue doc
2018-09-14 10:06:55 -07:00
Raymond Hettinger 902bcd9a1e
Note that distinct argument patterns can be cached separately (GH-9298) 2018-09-14 00:53:20 -07:00
Lisa Roach 5ac704306f bpo-33073: Adding as_integer_ratio to ints. (GH-8750) 2018-09-13 23:56:23 -07:00
Windson yang 1aeba7458d bpo-34552: Clarify built-in types comparisons (GH-9035)
Some updates to ancient text about comparisons; fixes bp-34552.
2018-09-13 21:50:18 -07:00
Carol Willing 4e824e9649 bpo-33649: Polish asyncio subprocess and sync docs (GH-9285)
Second pass for asyncio subprocess and sync docs.


https://bugs.python.org/issue33649
2018-09-13 18:28:19 -07:00
Andrew Svetlov 11194c877c
bpo-34666: Implement stream.awrite() and stream.aclose() (GH-9274) 2018-09-13 16:53:49 -07:00
Carol Willing a3c8ba7235 polish exceptions and platforms (GH-9272) 2018-09-13 16:14:41 -07:00
Carol Willing 1abba455d1 Polish doc as part of asyncio doc improvement (GH-9185) 2018-09-12 22:40:37 -07:00
Carol Willing 6d9767fb26 edit async policy doc - second pass (GH-9235) 2018-09-12 17:09:08 -07:00
Carol Willing 5b7cbd602e bpo-33649: Edit asyncio eventloop doc - second pass (GH-9233) 2018-09-12 17:05:17 -07:00
Tony Flury 2087023fde bpo-32933: Implement __iter__ method on mock_open() (GH-5974) 2018-09-13 01:21:16 +03:00
Benjamin Peterson 5b10d5111d
closes bpo-34004: Skip lock interruption tests on musl. (GH-9224)
Returning EINTR from pthread semaphore or lock acquisition is an optional POSIX
feature. musl does not provide this feature, so some threadsignal tests fail
when Python is built against it.

There's no good way to test for musl, so we skip if we're on Linux and not using
glibc pthreads.

Also, hedge in the threading documentation about when we can provide interrupts
from lock acquisition.
2018-09-12 13:48:03 -07:00
Bumsik Kim aca819fb49 bpo-33649: Fix doc to reflect changes in 47cd10d (or bpo-23347) (GH-9219) 2018-09-12 11:31:56 -07:00
Raymond Hettinger 9dfa0fe587
bpo-34637: Make the *start* argument for *sum()* visible as a keyword argument. (GH-9208) 2018-09-12 10:54:06 -07:00
Ethan Furman f52237400b bpo-33437: add __new__ vs __init__ example (GH-9145)
Improve Enum docs.


https://bugs.python.org/issue33437
2018-09-12 10:00:30 -07:00
Cheryl Sabella 731ff68eee closes bpo-25041: Document AF_PACKET socket address format. (GH-4092) 2018-09-11 17:32:15 -07:00
Yury Selivanov 8be876e44b
bpo-33649: Cleanup asyncio/streams and asyncio/synchronization docs (GH-9192) 2018-09-11 17:10:37 -07:00
Danish Prakash 9c223794c7 bpo-34365: Update date object documentation (GH-8814)
Python 3.x does not fall back to comparing object addresses when comparing two `dt` objects.

<!-- issue-number: [bpo-34365](https://www.bugs.python.org/issue34365) -->
https://bugs.python.org/issue34365
<!-- /issue-number -->
2018-09-11 13:59:23 -07:00
Bram b4ec36200a bpo-34613: document the correct value of limit argument of asyncio.StreamReader (GH-9121)
The default value of asyncio.StreamReader *limit* is `_DEFAULT_LIMIT` instead of `None`.

<!-- issue-number: [bpo-34613](https://www.bugs.python.org/issue34613) -->
https://bugs.python.org/issue34613
<!-- /issue-number -->
2018-09-11 11:45:26 -07:00
wim glenn 08bcf647d8 bpo-28617 Fixed docs inaccuracies about the types that support membership tests (GH-9086)
<!-- issue-number: [bpo-28617](https://www.bugs.python.org/issue28617) -->
https://bugs.python.org/issue28617
<!-- /issue-number -->
2018-09-11 10:44:52 -07:00
Yury Selivanov 7c7605ff11
bpo-33649: First asyncio docs improvement pass (GH-9142)
Rewritten/updated sections:

* Event Loop APIs
* Transports & Protocols
* Streams
* Exceptions
* Policies
* Queues
* Subprocesses
* Platforms
2018-09-11 09:54:40 -07:00
Zackery Spytz 3666b3c1f6 bpo-33032: Mention the implicit cache in struct.Struct() docs (GH-7700)
Mention the implicit cache in struct.Struct() docs.

Consistent with the re.compile documentation note.
2018-09-10 21:37:33 -07:00
Raymond Hettinger 2064bb6d57
Fix missing line from example shell session (GH-9143) 2018-09-10 18:43:08 -07:00
Matthias Bussonnier ffa198c642 bpo-33487: improve BZ2File Deprecation and documentation. (GH-6785)
Emit warning when None passed explicitly, list Python version since
deprecation in warning message and docs.
2018-09-10 18:15:56 -07:00
Ville Skyttä 959625b5a5 Use bytes.hex instead of binascii.hexlify in pbkdf2_hmac example (GH-8420) 2018-09-10 18:07:19 -07:00
Rahul Jha 9430652535 bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)
* bpo-33217: Raise TypeError for non-Enum lookups in Enums
2018-09-10 11:21:04 -07:00
Matthias Bussonnier 51a4743d19 bpo-33604: Remove deprecated HMAC default value marked for removal in 3.8 (GH-7063)
HMAC's digestmod was deprecated marked for removal, this removes it as planned.
2018-09-10 11:10:01 -07:00
Sebastian Rittau 78deb7f332 closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965) 2018-09-10 10:29:43 -07:00
Serhiy Storchaka d700f97b62
bpo-20104: Change the file_actions parameter of os.posix_spawn(). (GH-6725)
* Make its default value an empty tuple instead of None.
* Make it a keyword-only parameter.
2018-09-08 14:48:18 +03:00
Pablo Aguiar d5fbe9b1a3 bpo-34246: Use no mutable default args in smtplib (GH-8554)
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
2018-09-07 23:04:48 +01:00
Pablo Galindo 254a4663d8
bpo-20104: Add flag capabilities to posix_spawn (GH-6693)
Implement the "attributes objects" parameter of `os.posix_spawn` to complete the implementation and fully cover the underlying API.
2018-09-07 16:44:24 +01:00
Victor Stinner 5e922658fb
bpo-34605: Avoid master/slave terms (GH-9101)
* Replace "master process" with "parent process"
* Replace "master option mappings" with "main option mappings"
* Replace "master pattern object" with "main pattern object"
* ssl: replace "master" with "server"
* And some other similar changes
2018-09-07 17:30:33 +02:00
Marcel Plch 77b112cd56 bpo-34097: Polish API design (GH-8725)
Move strict_timestamps to constructor.
2018-08-31 16:43:31 +02:00
Carl Meyer d658deac60 bpo-21145: Add cached_property decorator in functools (#6982)
Robust caching of calculated properties is
harder than it looks at first glance, so add
a solid, well-tested implementation to the
standard library.
2018-08-28 17:11:56 +10:00
Louis Sautier 3fe89dac42 bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834) 2018-08-27 18:45:26 +08:00
Alexey Izbyshev 44838be9f7 closes bpo-34502: Remove a note about utf8_mode from sys.exit() docs. (GH-8928) 2018-08-25 11:23:00 -07:00
Andrés Delfino 2e5d2ea208 Fix markup in stdtypes documentation (GH-8905) 2018-08-25 07:08:20 -07:00
Alexander Vasin 416cbce22d Fixed typo with asynccontextmanager code example (GH-8845)
`yield conn`, instead of just `yield`.
2018-08-24 19:38:11 -07:00
Daniel Dương 075b3c3259 Fix typo in the dataclasses's doc (GH-8896) 2018-08-24 05:19:24 -04:00
Anthony Sottile cc18258daf Fix doc for `add_subparsers` arguments (GH-8884)
There was a missing comma.
2018-08-23 20:08:54 -07:00
Jelle Zijlstra b8a181f4ae Fix typo in asyncio.BoundedSemaphore docs (GH-8882)
semapthores -> semaphores
2018-08-23 18:50:00 -07:00
Ville Skyttä c33bb5d401 Make it more clear that setUpClass runs before each class, not "class run" (GH-8844) 2018-08-23 07:49:18 -07:00
Berker Peksag e7d4b2f205
bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)
Previously, its behavior was platform-dependent and there was no error checking
under Windows.
2018-08-22 21:21:05 +03:00
Berker Peksag 225b055480
bpo-22057: Clarify eval() documentation (GH-8812)
If a globals dictionary without a '__builtins__' key is passed to
eval(), a '__builtins__' key will be inserted to the dictionary:

    >>> eval("print('__builtins__' in globals())", {})
    True

(As a result of this behavior, we can use the builtins
print() and globals() even if we passed a dictionary without a
'__builtins__' key to eval().)
2018-08-19 13:25:33 +03:00
Andrés Delfino 93b5655c04 bpo-34432: doc Mention complex and decimal.Decimal on str.format not about locales (GH-8808) 2018-08-18 13:36:24 -04:00
Alfred Perlstein a2510732da Warn not to set SIGPIPE to SIG_DFL (#6773) 2018-08-17 14:48:05 +01:00
Sebastian Rittau c53aaec793 bpo-34418: Fix HTTPErrorProcessor documentation (GH-8793)
The http_response() and https_response() methods of the HTTPErrorProcessor
class have two required parameters, 'request' and 'response'.
2018-08-17 12:47:32 +03:00
Berker Peksag e0b5b2096e
bpo-34384: Fix os.readlink() on Windows (GH-8740)
os.readlink() now accepts path-like and bytes objects on Windows.
Previously, support for path-like and bytes objects was only
implemented on Unix.

This commit also merges Unix and Windows implementations of
os.readlink() in one function and adds basic unit tests to increase
test coverage of the function.
2018-08-15 13:03:41 +03:00
Ville Skyttä da12063f2f smtplib documentation fixes (GH-8708)
* SMTP.startssl: Fix doc on keyfile and certfile use

* SMTP.startssl: Add missing keyfile and certfile deprecation notice

* SMTP: Doc grammar fixes
2018-08-12 20:39:19 -07:00
Andrés Delfino 65b5ef02ec Fix the versionadded indentation in exec_module doc (GH-8719) 2018-08-11 23:50:46 -07:00
Evan Allrich 9e84084851 bpo-34379: Doc: Move note for json.dump (GH-8730) 2018-08-11 16:34:02 +09:00
Berker Peksag 84a13fbda0
bpo-9372: Deprecate several __getitem__ methods (GH-8609)
The __getitem__ methods of DOMEventStream, FileInput,
and FileWrapper classes ignore their 'index' parameters
and return the next item instead.
2018-08-11 09:05:04 +03:00
Andriy Maletsky 22d131a7f9 Doc: add missing capture_output arg to subprocess.run() signature (#8374) 2018-08-09 13:01:54 -07:00
Alex Grönholm cca4eec3c0 bpo-34270: Make it possible to name asyncio tasks (GH-8547)
Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
2018-08-08 17:06:47 -04:00
Mikhail Terekhov d2ac400267 bpo-34335: Use async/await syntax in documentation examples (GH-8674) 2018-08-07 13:29:06 -07:00
Xtreak 5b2657fb8c bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
Patch by Terry Jan Reedy.
2018-08-06 15:55:03 -04:00
Terry Jan Reedy 28c7f8c8ce
bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (#8673)
* bpo-34273: Change 'Fixed point' to 'Fixed-point notation'.
The change in the mini language floating point and decimal table
is consistent with 'Exponential notation' and clarifies that we
are referring to the output notation, not an object type.

* Update string.rst

* Update string.rst

* Update string.rst

* Update string.rst
2018-08-06 08:41:17 -04:00
Ville Skyttä 336c945858 bpo-34336: Don't promote possibility to leave out typing.Optional (#8677) 2018-08-05 17:38:04 +01:00
Berker Peksag 2e5566d9e7
Fix reST markup in unittest documentation (GH-8665) 2018-08-04 00:56:55 +03:00
Stefan Otte 46dc4e34ed bpo-34329: Doc'd how to remove suffix of pathlib.Path() (GH-8655) 2018-08-03 23:49:42 +03:00
Andrés Delfino b6efc2cf97 Improve the grammar in `range` documentation. (GH-8628)
Remove unnecessary "that" in the sentence.
2018-08-02 22:12:51 -07:00
torsava f394ee5eaf bpo-27910: Update documentation of traceback module (GH-6116)
In the documentation for the traceback module, the definitions of functions
extract_tb(), format_list() and classmethod StackSummary.from_list()
mention the old style 4-tuples that these functions used to return or accept.

Since Python 3.5, however, they return or accept a FrameSummary object
instead of a 4-tuple, or a StackSummary object instead of a list of 4-tuples.

Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
2018-08-02 19:08:59 +03:00
Marcel Plch a2fe1e52eb bpo-34097: Add support for zipping files older than 1980-01-01 (GH-8270)
ZipFile can zip files older than 1980-01-01 and newer than 2107-12-31 using
a new strict_timestamps parameter at the cost of setting the timestamp
to the limit.
2018-08-02 15:04:52 +02:00
MartinAltmayer 944451cd8d bpo-34263 Cap timeout submitted to epoll/select etc. to one day. (GH-8532) 2018-07-31 10:06:12 -04:00
Raymond Hettinger 9c18b1ae52
bpo-33089: Add math.dist() for computing the Euclidean distance between two points (GH-8561) 2018-07-31 00:45:49 -07:00
Serhiy Storchaka f1d36d8efa
bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)
* help(hashlib) didn't work because of incorrect module name in blake2b and
  blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
  accepted keyword argument "string" for binary data, but documented as
  accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
  keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
  which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
  positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
  shake_*() and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

* More accurately specified input and result types for strings, bytes and
  bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.
2018-07-31 09:50:16 +03:00
Elvis Pranskevichus 22d25085db bpo-34075: Deprecate non-ThreadPoolExecutor in loop.set_default_executor() (GH-8533)
Various asyncio internals expect that the default executor is a
`ThreadPoolExecutor`, so deprecate passing anything else to
`loop.set_default_executor()`.
2018-07-30 12:42:43 +02:00
Berker Peksag a71fed0b75 bpo-8145: Improve isolation_level documentation (GH-8499)
Initial patch by R. David Murray.
2018-07-29 10:01:38 +01:00
Raymond Hettinger c6dabe37e3
bpo-33089: Multidimensional math.hypot() (GH-8474) 2018-07-28 07:48:04 -07:00
Elena Oat 5032692746 bpo-24356: Specify which Python binary will be used with venv (GH-6589) 2018-07-28 13:58:05 +01:00
johnthagen 95dfb9c3ae bpo-33921: Clarify how to bind to all interfaces using socket (GH-7877)
Clarify how to bind to all interfaces using socket
2018-07-28 11:03:23 +01:00
Andrés Delfino 937fb55d35 bpo-5978: Document that profiling needs cmd/function to return (GH-7938)
<!-- issue-number: bpo-5978 -->
https://bugs.python.org/issue5978
<!-- /issue-number -->
2018-07-28 11:01:24 +01:00
Sanyam Khurana b4bc5cab82 bpo-29710: Clarify documentation for Bitwise binary operation (GH-1691)
Mathematically, bitwise operations on integers behave as if there were an
infinite number of sign bits. Pragmatically, that gives the same answer as
using one extra sign bit for the bitwise logical operations.
2018-07-28 15:15:50 +10:00
Mariatta 95d34c2a37
Fix site module documentation. (GH-8441)
The script will exit with the number 0 (zero), instead of the letter O.
2018-07-24 09:14:20 -07:00
Serhiy Storchaka 02ec92fa7b
bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)
Also make getchildren() and getiterator() emitting
a DeprecationWarning instead of PendingDeprecationWarning.
2018-07-24 12:03:34 +03:00
Alexander Marshalov e22072fb11 bpo-34149: Behavior of the min/max with key=None (GH-8328)
Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().
2018-07-23 20:58:21 -07:00
Matthias Bussonnier bde782bb59 bpo-33468: Add try-finally contextlib.contextmanager example (GH-7816) 2018-07-24 00:10:56 +03:00
Berker Peksag 7a3056fa7d
bpo-21446: Update reload fixer to use importlib (GH-8391) 2018-07-23 09:49:08 +03:00
Andrés Delfino cb9c299a55 Fix versionchanged indentation in popitem documentation (GH-8387) 2018-07-21 15:14:56 -07:00
Raymond Hettinger feabae9617
Clarify ValueError's broad applicability (GH-8313) 2018-07-17 08:35:26 -07:00
Raymond Hettinger 01b7d58982
bpo-34123: Fix missed documentation update for dict.popitem(). (GH-8292) 2018-07-16 17:20:15 -07:00
Jon Ribbens c9265c1534 bpo-34124: Fix markup of message_from_binary_file() signature (GH-8297) 2018-07-16 20:19:42 +03:00
Andrés Delfino 379e9d639a bpo-4260: Document that ctypes.xFUNCTYPE are decorators (GH-7924) 2018-07-13 15:50:20 +03:00
Andrés Delfino 33aefad342 Doc: Point to Simple statements section instead of PEP (GH-8238) 2018-07-11 18:44:06 +09:00
Tom Faulkner da5e9476bb Dataclasses: Fix example on 30.6.8, add method should receive a list rather than an integer. (GH-8038)
Change example function to append rather than add lists.
2018-07-10 22:39:57 -04:00
Daniel Porteous c287545d62 bpo-34067: Include a more easily understood example for nullcontext (GH-8158)
Include a more easily understood example for nullcontext
2018-07-09 23:49:29 +10:00
Serhiy Storchaka 2a9b8babf0
bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684) 2018-07-09 11:47:45 +03:00
Andrés Delfino f85af035c5 Fix margin in sentinel and mock_open (GH-8188) 2018-07-08 17:28:51 -07:00
Marcin Niemira bc9aa813a3 bpo-34061: Document sqlite3.NotSupportedError (GH-8172) 2018-07-08 15:02:58 +03:00
Sergey Fedoseev 0830858aee bpo-34041: Allow creating deterministic functions in Connection.create_function() (GH-8086) 2018-07-08 10:09:20 +03:00
Marcin Niemira 9c5ba09748 closes bpo-34050: Fix link in SSL docs (GH-8173) 2018-07-07 15:24:20 -07:00
Andrés Delfino b6bb77c2b8 bpo-33804: Document that the argument for io.TextIOBase.read() is optional (GH-7510) 2018-07-07 23:17:16 +03:00
Andrés Delfino 2d748389dc Fix moduleauthor/sectionauthor directives in Enum (GH-8117) 2018-07-07 22:01:25 +03:00
Andrés Delfino 03dd0e794e Add missing closing parentheses (GH-8144) 2018-07-07 22:00:46 +03:00
Dong-hee Na 2800dcf656 bpo-34065: Improve the markup of logging.basicConfig() arguments (GH-8153) 2018-07-07 15:36:40 +03:00
Julien Palard 7943c5e8b5
Doc: Remove superfluous markup. (GH-8112)
The line is speaking of a list of commands, not the list command.
2018-07-06 11:15:13 +02:00
Sergey Fedoseev f12028809b versionadded -> versionchanged for all 'X parameter was added' for uniformity. (GH8114)
Per the recommendation in our Developer's Guide:
  https://devguide.python.org/documenting/#paragraph-level-markup
2018-07-05 17:01:16 -07:00
Windson yang 3ae2e33a61 classify abs() argument type (GH-8103) 2018-07-05 16:09:53 -07:00
Gerrit Holl bd81cbd584 DOC: In `reduce`, refer to `accumulate` (GH-7930) 2018-07-04 15:26:32 -07:00
Farhaan Bukhsh 5b6e49a139 bpo-30516: Fix documentation issue with -timedelta in datetime (GH-7348)
This commit fixes the -timedelta overfllow issue not documented properly.

Signed-off-by: Farhaan Bukhsh <farhaan.bukhsh@gmail.com>
2018-07-04 19:42:05 +01:00
Sergey Fedoseev 831c29721d bpo-34018: Doc'd that type names of SQLite converters are case-insensitive. (GH-8042) 2018-07-03 14:59:32 +03:00
INADA Naoki c6cd164cff
bpo-30660: Doc: Optimize PNG files by optipng (GH-8032)
Using OptiPNG 0.7.7.
Used command is: `find . -name '*.png' | xargs optipng -o7`
2018-07-01 16:02:52 +09:00
Tal Einat 6dc57e2a20
bpo-31938: Convert selectmodule.c to Argument Clinic (GH-4265) 2018-06-30 23:02:48 +03:00
INADA Naoki fe524df37c
Doc: Remove unused image file (GH-8027) 2018-07-01 03:04:34 +09:00