Commit Graph

23714 Commits

Author SHA1 Message Date
Serhiy Storchaka 559e7f165a
bpo-39648: Expand math.gcd() and math.lcm() to handle multiple arguments. (GH-18604)
* bpo-39648: Expand math.gcd() and math.lcm() to handle multiple arguments.

* Simplify fast path.

* Difine lcm() without arguments returning 1.

* Apply suggestions from code review

Co-Authored-By: Mark Dickinson <dickinsm@gmail.com>

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2020-02-23 11:21:29 +00:00
ananthan-123 fbe2e0bb8a
bpo-17422: Language reference should specify restrictions on class namespace (#18559)
The language reference now specifies restrictions on class namespaces.  Adapted from a patch by Ethan Furman.
2020-02-22 09:56:01 -08:00
Stefan Krah a025d4ca99
bpo-39576: docs: set context for decimal arbitrary precision arithmetic (#18594) 2020-02-21 21:27:37 +01:00
Julien Danjou d4d17fd2cf
fix(doc): set correct RST syntax for c:function (GH-18589)
The current content is not rendered since the syntax is not correct.
2020-02-21 11:47:41 +01:00
Pete Wicken 424e5686d8
bpo-38657: Clarify numeric padding behaviour in string formatting (GH-17036)
Make the definition of the width more explicit that it includes any
extra signs added by other options.


https://bugs.python.org/issue38657



Automerge-Triggered-By: @Mariatta
2020-02-20 21:53:12 -08:00
ananthan-123 f2ee21d858
bpo-39479:Add math.lcm() function: Least Common Multiple (#18547)
* Update math.rst

* Update math.rst

* updated whats new

* Update test_math.py

* Update mathmodule.c

* Update mathmodule.c.h

* Update ACKS

* 📜🤖 Added by blurb_it.

* Update 3.9.rst

* Update 2020-02-18-12-37-16.bpo-39479.j3UcCq.rst

* Update math.rst

* Update 2020-02-18-12-37-16.bpo-39479.j3UcCq.rst

* Update test_math.py

* Update ACKS

* Update mathmodule.c.h

* Update mathmodule.c

* Update mathmodule.c.h

* Update mathmodule.c.h

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-02-19 18:21:37 +00:00
Victor Stinner 4dee92b0ad
Revert "bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags passed (#18314)" (GH-18553)
This reverts commit d83b6600b2.
2020-02-19 14:23:47 +01:00
ananthan-123 ab6423fe2d
bpo-39572: Document ’total’ flag of TypedDict (GH-18554) 2020-02-18 20:33:05 -08:00
Cheryl Sabella a4ba8a3983
Include subsections in TOC for PDF version of docs. (GH-9629) 2020-02-19 00:01:15 +01:00
Victor Stinner af5ee3ff61
bpo-39674: Revert "bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596)" (GH-18545)
This reverts commit ef092fe990.

Update collections __getattr__() and documentation to defer aliases
removal to Python 3.10.
2020-02-18 16:28:53 +01:00
Hai Shi a7847590f0
bpo-36465: Update doc of init_config.rst (GH-18520) 2020-02-17 10:18:19 +01:00
idomic d83b6600b2
bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags passed (#18314)
* Hard reset + cherry piciking the changes.

* 📜🤖 Added by blurb_it.

* Added @vstinner News

* Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst

Co-Authored-By: Victor Stinner <vstinner@python.org>

* Hard reset to master

* Hard reset to master + latest changes

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2020-02-17 10:05:11 +01:00
Serhiy Storchaka 85a2eef473
bpo-32892: Update the documentation for handling constants in AST. (GH-18514) 2020-02-17 11:03:00 +02:00
Vinay Sajip 1ed61617a4
bpo-12915: Add pkgutil.resolve_name (GH-18310) 2020-02-14 22:02:13 +00:00
Serhiy Storchaka f632736023
bpo-39545: Document changes in the support of await in f-strings. (GH-18456)
https://bugs.python.org/issue39545
2020-02-13 15:57:35 -08:00
Dong-hee Na d905df766c
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
2020-02-13 18:37:17 +01:00
Brandt Bucher 968dcd9e7a
bpo-39573: Fix bad copy-paste in Py_SET_SIZE (GH-18496) 2020-02-13 18:34:45 +01:00
Saiyang Gou 7514f4f625
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407) 2020-02-13 07:47:42 +00:00
Serhiy Storchaka 8c579b1cc8
bpo-32856: Optimize the assignment idiom in comprehensions. (GH-16814)
Now `for y in [expr]` in comprehensions is as fast as a simple
assignment `y = expr`.
2020-02-12 12:18:59 +02:00
Victor Stinner f3fda37468
bpo-38644: Rephrase What's New entry (GH-18461) 2020-02-11 17:50:10 +01:00
Victor Stinner f3e7ea5b8c
bpo-39500: Document PyUnicode_IsIdentifier() function (GH-18397)
PyUnicode_IsIdentifier() does not call Py_FatalError() anymore if the
string is not ready.
2020-02-11 14:29:33 +01:00
Roger Hurwitz 4eb9f4313c
bpo-38374: Remove weakref.ReferenceError from docs (GH-18452)
Reflecting changes to the code, removed weakref.ReferenceError from weakref.rst and exceptions.rst.

Issue submitter provided evidence that the `weakref.ReferenceError` alias for `ReferenceError` was removed from the code in 2007.  Working with @gvanrossum at PyCascades CPython sprint we looked at the code and confirmed that `weakref.ReferenceError` was no longer in `weakref.py`.

Based on that analysis I removed references `weakref.ReferenceError` from the two documents where it was still being referenced: `weakref.rst` and `exceptions.rst`. 


https://bugs.python.org/issue38374
2020-02-10 22:56:02 -08:00
Ogi Moore c4a65ed7fe
bpo-39417: Fix broken link to guide to building venvs (GH-18432) 2020-02-10 15:51:01 -08:00
Eric Wieser bf15d5b775
Correct the documented default encoding (GH-18429)
From the source for `PyUnicode_Decode`, the implementation is:
```
if (encoding == NULL) {
    return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL);
}
```
which is pretty clearly not defaulting to ASCII.

---

I assume this needs neither a news entry nor bpo link.
2020-02-10 15:32:18 -08:00
Tim D. Smith 95d024d585
bpo-13826: Clarify Popen constructor example (GH-18438)
Clarifies that the use of `shlex.split` is more instructive than
normative, and provides a simpler example.





https://bugs.python.org/issue13826
2020-02-10 14:51:01 -08:00
Roger Hurwitz 37c55b2b49
bpo-39594: Fix typo in os.times documentation (GH-18443)
There was an extra space in the url markup, causing the documentation not rendered properly.

https://bugs.python.org/issue39594
2020-02-10 14:50:19 -08:00
Carl d68e0a8a16
Issue3950: Fix docs for default locale used by gettext to match implementation (#18435)
documentation for default locale directory Doc/library/gettext.rst changed to match gettext implementation line 63.
2020-02-10 13:15:34 -08:00
Christophe Nanteuil 3c5dec65e9
Remove redundant references in struct doc (GH-18053) 2020-02-10 12:17:54 -08:00
Wellington Pardim 6c9974e12c
bpo-39369 Doc: Update mmap readline method documentation (GH-17957)
* Update mmap readline method documentation

Update mmap `readline` method description. The fact that the `readline` method does update the file position should not be ignored since this might give the impression for the programmer that it doesn't update it.

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-02-10 12:13:41 -08:00
Brian Curtin e00c1d0c45
Remove note saying patch is straightforward (#18431)
While `unittest.mock.patch` is a great thing, it is not straightforward.
If it were straightforward there wouldn't be such a huge amount of
documentation for it, and frankly, when myself and others who I've
read about often struggle to figure out what on earth `patch()` wants,
coming to the docs to read that it's straightforward is not helpful.
2020-02-10 10:47:17 -07:00
Hugo van Kemenade 29b3fc0a18
bpo-39586: Deprecate distutils bdist_msi command (GH-18415) 2020-02-10 14:26:40 +01:00
idomic 5305cc9dbf bpo-39128: Added happy_eyeballs_delay, interleave to function signature (GH-18315) 2020-02-10 10:48:40 +01:00
Don Kirkby 3ed4d25158
Grammar fix in tutorial (GH-18425) 2020-02-09 19:57:46 -05:00
Saiyang Gou 0edc2c7678
Doc: sys.__unraisablehook__ and bytearray.hex separators are new in 3.8 (GH-17884)
Minor fix in documentation:

- `sys.__unraisablehook__` is new in version 3.8
- Optional `sep` and `bytes_per_sep` parameters for `bytearray.hex` is also supported in Python 3.8 (just like `bytes.hex`)
2020-02-07 16:48:06 -08:00
Victor Stinner dc7a50d73a
bpo-39350: Fix fractions for int subclasses (GH-18375)
Fix regression in fractions.Fraction if the numerator and/or the
denominator is an int subclass. The math.gcd() function is now
used to normalize the numerator and denominator. math.gcd() always
return a int type. Previously, the GCD type depended on numerator
and denominator.
2020-02-07 23:42:51 +01:00
Victor Stinner b10dc3e7a1
bpo-39573: Add Py_SET_SIZE() function (GH-18400)
Add Py_SET_SIZE() function to set the size of an object.
2020-02-07 12:05:12 +01:00
Victor Stinner d2ec81a8c9
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
2020-02-07 09:17:07 +01:00
Victor Stinner c86a11221d
bpo-39573: Add Py_SET_REFCNT() function (GH-18389)
Add a Py_SET_REFCNT() function to set the reference counter of an
object.
2020-02-07 01:24:29 +01:00
Julien Palard 446463f8db
bpo-39534: Doc: Clarify return in finally (GH-18324) 2020-02-06 23:16:48 +01:00
Victor Stinner 227af8e217
What's New in Python 3.9: sort improved modules (GH-18383) 2020-02-06 23:03:01 +01:00
Victor Stinner 2844336e6b
bpo-39542: Document limited C API changes (GH-18378) 2020-02-06 22:41:34 +01:00
Petr Viktorin 3f563cea56
bpo-39245: Make Vectorcall C API public (GH-17893)
* Add backcompat defines and move non-limited API declaration to cpython/

This partially reverts commit 2ff58a24e8
which added PyObject_CallNoArgs to the 3.9+ stable ABI. This should not
be done; there are enough other call APIs in the stable ABI to choose from.

* Adjust documentation

Mark all newly public functions as added in 3.9.
Add a note about the 3.8 provisional names.
Add notes on public API.

* Put PyObject_CallNoArgs back in the limited API

* Rename PyObject_FastCallDict to PyObject_VectorcallDict
2020-02-06 15:48:27 +01:00
Victor Stinner 509dd90f46
bpo-39542: Convert PyType_Check() to static inline function (GH-18364)
Convert PyType_HasFeature(), PyType_Check() and PyType_CheckExact()
macros to static inline functions.
2020-02-05 14:24:17 +01:00
Jakub Stasiak cf5b109dbb
bpo-39491: Merge PEP 593 (typing.Annotated) support (#18260)
* bpo-39491: Merge PEP 593 (typing.Annotated) support

PEP 593 has been accepted some time ago. I got a green light for merging
this from Till, so I went ahead and combined the code contributed to
typing_extensions[1] and the documentation from the PEP 593 text[2].

My changes were limited to:

* removing code designed for typing_extensions to run on older Python
  versions
* removing some irrelevant parts of the PEP text when copying it over as
  documentation and otherwise changing few small bits to better serve
  the purpose
* changing the get_type_hints signature to match reality (parameter
  names)

I wasn't entirely sure how to go about crediting the authors but I used
my best judgment, let me know if something needs changing in this
regard.

[1] 8280de241f/typing_extensions/src_py3/typing_extensions.py
[2] 17710b8798/pep-0593.rst
2020-02-04 17:10:19 -08:00
Saiyang Gou 95f6001021
bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824) 2020-02-05 11:15:00 +11:00
Baljak 2545fa8762
Fix MinGW library generation command (GH-17917)
To print the exports to stdout, the gendef command requires the option "-". Without this option, no output is generated.
2020-02-05 11:10:16 +11:00
Chris Withers b6999e5690
add whatsnew that was missed from 31d6de5aba (#18344) 2020-02-04 08:05:25 +00:00
Adorilson Bezerra 5807efd4c3
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973) 2020-02-03 18:11:19 +01:00
Victor Stinner c6e5c1123b
bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)
Remove:

* COUNT_ALLOCS macro
* sys.getcounts() function
* SHOW_ALLOC_COUNT code in listobject.c
* SHOW_TRACK_COUNT code in tupleobject.c
* PyConfig.show_alloc_count field
* -X showalloccount command line option
* @test.support.requires_type_collecting decorator
2020-02-03 15:17:15 +01:00
Kyle Stanley 339fd46cb7
bpo-39349: Add *cancel_futures* to Executor.shutdown() (GH-18057) 2020-02-02 13:49:00 +01:00
James Corbett b94737a4af
fixes typos in http.client documentation (#18300) 2020-02-01 04:31:00 -08:00
Andrew Svetlov 90d9ba6ef1
bpo-34793: Drop old-style context managers in asyncio.locks (GH-17533) 2020-02-01 13:12:52 +02:00
Victor Stinner 4d96b4635a
bpo-39511: PyThreadState_Clear() calls on_delete (GH-18296)
PyThreadState.on_delete is a callback used to notify Python when a
thread completes. _thread._set_sentinel() function creates a lock
which is released when the thread completes. It sets on_delete
callback to the internal release_sentinel() function. This lock is
known as Threading._tstate_lock in the threading module.

The release_sentinel() function uses the Python C API. The problem is
that on_delete is called late in the Python finalization, when the C
API is no longer fully working.

The PyThreadState_Clear() function now calls the
PyThreadState.on_delete callback. Previously, that happened in
PyThreadState_Delete().

The release_sentinel() function is now called when the C API is still
fully working.
2020-02-01 02:30:25 +01:00
Julien Palard 58a4054760
Doc: Fix s/pseudo random/pseudo-random/ (GH-18289) 2020-01-31 10:50:14 +01:00
Victor Stinner 17c68b8107
bpo-38631: Replace Py_FatalError() with assert() in ceval.c (GH-18279)
Replace a few Py_FatalError() calls if tstate is NULL with
assert(tstate != NULL) in ceval.c.

PyEval_AcquireThread(), PyEval_ReleaseThread() and
PyEval_RestoreThread() must never be called with a NULL tstate.
2020-01-30 12:20:48 +01:00
Victor Stinner c38fd0df2b
bpo-39353: binascii.crc_hqx() is no longer deprecated (GH-18276)
The binascii.crc_hqx() function is no longer deprecated.
2020-01-30 09:56:40 +01:00
Bonifacio de Oliveira d47d0c8e9f
Improve grammar in the import system reference documentation (GH-18209)
Replaced the period with a comma.

Automerge-Triggered-By: @Mariatta
2020-01-29 18:23:50 -08:00
Julien Palard 35eac4500a
Doc: Fix external links to functional programming tutorial. (GH-18249) 2020-01-29 14:10:54 +01:00
Joannah Nanjekye e1e80002e2
bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* 📜🤖 Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-01-29 21:20:53 +10:00
Rémi Lapeyre 2cca8efe46 bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412) 2020-01-28 21:47:03 +09:00
Inada Naoki 148610d88a
bpo-39287: Doc: Add UTF-8 mode section in using/windows. (GH-17935)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
2020-01-28 19:12:31 +09:00
Raymond Hettinger 01bf2196d8
bpo-36018: Minor fixes to the NormalDist() examples and recipes. (GH-18226)
* Change the source for the SAT data to a primary source.
* Fix typo in the standard deviation
* Clarify that the binomial probabalities are just for the Python room.
2020-01-27 18:31:46 -08:00
Terry Jan Reedy 2824c45a0a
bpo-39392: Turtle overlap fill depends on OS (#18223)
Whether or not overlap regions for self-intersecting polygons
or multiple shapes are filled depends on the operating system graphics,
typeof overlap, and number of overlaps.
2020-01-27 18:41:18 -05:00
Mark Shannon 8a4cd700a7
bpo-39320: Handle unpacking of **values in compiler (GH-18141)
* Add DICT_UPDATE and DICT_MERGE bytecodes. Use them for ** unpacking.

* Remove BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL, as they are now unused.

* Update magic number for ** unpacking opcodes.

* Update dis.rst to incorporate new bytecodes.

* Add blurb entry.
2020-01-27 09:57:45 +00:00
Raymond Hettinger 10355ed7f1
bpo-36018: Add another example for NormalDist() (#18191) 2020-01-25 20:21:17 -08:00
Juhana Jauhiainen 8271441d8b bpo-39374: Updated sorting documentation (GH-18177) 2020-01-25 14:18:58 -08:00
Windson yang 4b09dc79f4 bpo-36654: Add examples for using tokenize module programmically (#12947) 2020-01-25 22:23:00 +03:00
alclarks 7de617455e bpo-15243: Document __prepare__ as classmethod (GH-17124) 2020-01-25 21:49:58 +03:00
fireattack 9bfb4a7061 Update 3.8.rst (GH-18173)
Fixed the name of the contributor (@selik).
2020-01-25 10:08:13 -05:00
Paulo Henrique Silva 40c080934b bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521) 2020-01-25 10:53:54 +00:00
Victor Stinner b8d1262e8a
bpo-39395: putenv() and unsetenv() always available (GH-18135)
The os.putenv() and os.unsetenv() functions are now always available.

On non-Windows platforms, Python now requires setenv() and unsetenv()
functions to build.

Remove putenv_dict from posixmodule.c: it's not longer needed.
2020-01-24 14:05:48 +01:00
Victor Stinner 161e7b36b1
bpo-39413: Implement os.unsetenv() on Windows (GH-18163)
The os.unsetenv() function is now also available on Windows.
2020-01-24 11:53:44 +01:00
Ammar Askar 2d5097663d bpo-39361: Document the removal of PyTypeObject.tp_print (GH-18125) 2020-01-24 11:35:01 +01:00
Victor Stinner b9783d2e03
bpo-39429: Add a new "Python Development Mode" doc page (GH-18132) 2020-01-24 10:22:18 +01:00
Pablo Galindo 65ecc390c1
bpo-17005: Minor improvements to the documentation of TopologicalSorter (GH-18155) 2020-01-23 21:01:50 +00:00
Shanavas M 7142df5ea2 bpo-39431: Also mention nonlocal in assignment quirk (GH-17375) 2020-01-23 13:09:21 -05:00
Pablo Galindo 99e6c260d6
bpo-17005: Add a class to perform topological sorting to the standard library (GH-11583)
Co-Authored-By: Tim Peters <tim.peters@gmail.com>
2020-01-23 15:29:52 +00:00
Mark Shannon 13bc13960c
bpo-39320: Handle unpacking of *values in compiler (GH-17984)
* Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions.

* Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and  BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused.

* Update magic number and dis.rst for new bytecodes.
2020-01-23 09:25:17 +00:00
William Woodruff dd754caf14 bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)
`is_tarfile()` now supports `name` being a file or file-like object.
2020-01-22 18:24:16 -08:00
Dong-hee Na 1f0f102dec bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035) 2020-01-23 00:59:43 +03:00
Victor Stinner b73dd02ea7
Revert "bpo-39413: Implement os.unsetenv() on Windows (GH-18104)" (GH-18124)
This reverts commit 56cd3710a1.
2020-01-22 21:11:17 +01:00
Victor Stinner beea26b57e
bpo-39353: Deprecate the binhex module (GH-18025)
Deprecate binhex4 and hexbin4 standards. Deprecate the binhex module
and the following binascii functions:

* b2a_hqx(), a2b_hqx()
* rlecode_hqx(), rledecode_hqx()
* crc_hqx()
2020-01-22 20:44:22 +01:00
Inada Naoki 5bbac8cbdf
bpo-39377: json: Update doc about the encoding option. (GH-18076)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-01-22 19:01:24 +09:00
Keith Erskine 47be7d0108 PyLong_AsLongLong() docs should say 'long long' (#18082) 2020-01-21 19:14:13 +00:00
Victor Stinner 56cd3710a1
bpo-39413: Implement os.unsetenv() on Windows (GH-18104)
The os.unsetenv() function is now also available on Windows.

It is implemented with SetEnvironmentVariableW(name, NULL).
2020-01-21 16:13:09 +01:00
Carl Friedrich Bolz-Tereick 8698b34b68 improve the documentation of the LOAD_METHOD and CALL_METHOD (GH-18079) 2020-01-21 09:41:16 +09:00
Peter Bittner 8d57a4182f bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054) 2020-01-20 18:22:56 -05:00
Andrew Svetlov 2c49becc69
Fix asyncio.get_event_loop() documentation (GH-18051)
Mention that the function implicitly creates new event loop only if called from the main thread.
2020-01-21 00:46:38 +02:00
Grant Jenks ef8844f1bc Fix Lock.locked() to remove extra bold highlighting (#18042) 2020-01-17 14:54:44 -08:00
Victor Stinner 9baf242fc7
bpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)
Remove the buffering parameter of bz2.BZ2File. Since Python 3.0, it
was ignored and using it was emitting a DeprecationWarning. Pass an
open file object to control how the file is opened.

The compresslevel parameter becomes keyword-only.
2020-01-16 15:33:30 +01:00
Victor Stinner 4691a2f2a2
bpo-39350: Remove deprecated fractions.gcd() (GH-18021)
Remove fractions.gcd() function, deprecated since Python 3.5
(bpo-22486): use math.gcd() instead.
2020-01-16 11:02:51 +01:00
Victor Stinner 210c19e3c5
bpo-39351: Remove base64.encodestring() (GH-18022)
Remove base64.encodestring() and base64.decodestring(), aliases
deprecated since Python 3.1: use base64.encodebytes() and
base64.decodebytes() instead.
2020-01-16 10:24:16 +01:00
Oz N Tiram fad8b5674c bpo-39348: Fix code highlight for the SOCK_NONBLOCK example (GH-18018)
The previous double colon was wrongly place directly after Therefore.
Which produced a block without syntax highlighting. This fixes it
by separating the double colon from the text. As a result, sphinx now
properly highlights the python code.




https://bugs.python.org/issue39348
2020-01-15 15:55:13 -08:00
Daniel Olshansky 01602ae403 bpo-37958: Adding get_profile_dict to pstats (GH-15495)
pstats is really useful or profiling and printing the output of the execution of some block of code, but I've found on multiple occasions when I'd like to access this output directly in an easily usable dictionary on which I can further analyze or manipulate.

The proposal is to add a function called get_profile_dict inside of pstats that'll automatically return this data the data in an easily accessible dict.

The output of the following script:

```
import cProfile, pstats
import pprint
from pstats import func_std_string, f8

def fib(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    return fib(n-1) + fib(n-2)

pr = cProfile.Profile()
pr.enable()
fib(5)
pr.create_stats()

ps = pstats.Stats(pr).sort_stats('tottime', 'cumtime')

def get_profile_dict(self, keys_filter=None):
    """
        Returns a dict where the key is a function name and the value is a dict
        with the following keys:
            - ncalls
            - tottime
            - percall_tottime
            - cumtime
            - percall_cumtime
            - file_name
            - line_number

        keys_filter can be optionally set to limit the key-value pairs in the
        retrieved dict.
    """
    pstats_dict = {}
    func_list = self.fcn_list[:] if self.fcn_list else list(self.stats.keys())

    if not func_list:
        return pstats_dict

    pstats_dict["total_tt"] = float(f8(self.total_tt))
    for func in func_list:
        cc, nc, tt, ct, callers = self.stats[func]
        file, line, func_name = func
        ncalls = str(nc) if nc == cc else (str(nc) + '/' + str(cc))
        tottime = float(f8(tt))
        percall_tottime = -1 if nc == 0 else float(f8(tt/nc))
        cumtime = float(f8(ct))
        percall_cumtime = -1 if cc == 0 else float(f8(ct/cc))
        func_dict = {
            "ncalls": ncalls,
            "tottime": tottime, # time spent in this function alone
            "percall_tottime": percall_tottime,
            "cumtime": cumtime, # time spent in the function plus all functions that this function called,
            "percall_cumtime": percall_cumtime,
            "file_name": file,
            "line_number": line
        }
        func_dict_filtered = func_dict if not keys_filter else { key: func_dict[key] for key in keys_filter }
        pstats_dict[func_name] = func_dict_filtered

    return pstats_dict

pp = pprint.PrettyPrinter(depth=6)
pp.pprint(get_profile_dict(ps))
```

will produce:

```
{"<method 'disable' of '_lsprof.Profiler' objects>": {'cumtime': 0.0,
                                                      'file_name': '~',
                                                      'line_number': 0,
                                                      'ncalls': '1',
                                                      'percall_cumtime': 0.0,
                                                      'percall_tottime': 0.0,
                                                      'tottime': 0.0},
 'create_stats': {'cumtime': 0.0,
                  'file_name': '/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cProfile.py',
                  'line_number': 50,
                  'ncalls': '1',
                  'percall_cumtime': 0.0,
                  'percall_tottime': 0.0,
                  'tottime': 0.0},
 'fib': {'cumtime': 0.0,
         'file_name': 'get_profile_dict.py',
         'line_number': 5,
         'ncalls': '15/1',
         'percall_cumtime': 0.0,
         'percall_tottime': 0.0,
         'tottime': 0.0},
 'total_tt': 0.0}
 ```

 As an example, this can be used to generate a stacked column chart using various visualization tools which will assist in easily identifying program bottlenecks.



https://bugs.python.org/issue37958



Automerge-Triggered-By: @gpshead
2020-01-15 14:51:54 -08:00
Antoine dc0284ee8f Fix typo in multiprocessing.pool.AsyncResult.successful doc. (GH-17932)
Since 3.7 `successful` raises a `ValueError` as explained in the next text block from the documentation:

_Changed in version 3.7: If the result is not ready, ValueError is raised instead of AssertionError._

No issue associated with this PR.
Should be backported in 3.7 and 3.8.
2020-01-15 12:12:41 -08:00
Victor Stinner e85a305503
bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)
On Unix, subprocess.Popen.send_signal() now polls the process status.
Polling reduces the risk of sending a signal to the wrong process if
the process completed, the Popen.returncode attribute is still None,
and the pid has been reassigned (recycled) to a new different
process.
2020-01-15 17:38:55 +01:00
Elena Oat cf288b53e4 Fix AsyncMock base class in the docs (GH-18008) 2020-01-15 09:50:57 +00:00
Dong-hee Na 65a5ce247f bpo-39329: Add timeout parameter for smtplib.LMTP constructor (GH-17998) 2020-01-14 22:42:09 +01:00
Vinay Sajip 7d6378051f
bpo-38901: Allow setting a venv's prompt to the basename of the current directory. (GH-17946)
When a prompt value of '.' is specified, os.path.basename(os.getcwd()) is used to
configure the prompt for the created venv.
2020-01-14 20:49:30 +00:00
Kyle Pollina b4cdb3f60e Fix documentation in code.py (GH-17988) 2020-01-15 01:17:25 +05:30
Pablo Galindo a2ec3f07f7
bpo-39322: Add gc.is_finalized to check if an object has been finalised by the gc (GH-17989) 2020-01-14 12:06:45 +00:00
Géry Ogam 1d1b97ae64 bpo-39048: Look up __aenter__ before __aexit__ in async with (GH-17609)
* Reorder the __aenter__ and __aexit__ checks for async with
* Add assertions for async with body being skipped
* Swap __aexit__ and __aenter__ loading in the documentation
2020-01-14 21:58:29 +10:00
Mark Shannon 9af0e47b17
bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)
Break up COMPARE_OP into four logically distinct opcodes:
* COMPARE_OP for rich comparisons
* IS_OP for 'is' and 'is not' tests
* CONTAINS_OP for 'in' and 'is not' tests
* JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
2020-01-14 10:12:45 +00:00
Dong-hee Na 62e3973395 bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 (GH-17958) 2020-01-14 08:49:59 +01:00
Dong-hee Na a190e2ade1 bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959) 2020-01-13 20:34:34 +01:00
Victor Stinner c1ee6e5e9b
bpo-20443: Update What's New In Python 3.9 (GH-17986)
The sys.argv[0] change has been reverted.
2020-01-13 14:57:14 +01:00
Victor Stinner 0b2ab21956
bpo-39310: Add math.ulp(x) (GH-17965)
Add math.ulp(): return the value of the least significant bit
of a float.
2020-01-13 12:44:35 +01:00
Batuhan Taşkaya 61b14151cc bpo-39313: Add an option to RefactoringTool for using exec as a function (GH-17967)
https://bugs.python.org/issue39313


Automerge-Triggered-By: @pablogsal
2020-01-12 14:13:31 -08:00
Batuhan Taşkaya 6680f4a9f5 bpo-3530: Add advice on when to correctly use fix_missing_locations in the AST docs (GH-17172)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-12 20:38:53 +00:00
Victor Stinner 54cfbb2fee
bpo-39288: Add examples to math.nextafter() documentation (GH-17962) 2020-01-12 12:57:47 +01:00
Zac Hatfield-Dodds d7c7adde00 bpo-12159: Document sys.maxsize limit in len() function reference (GH-17934) 2020-01-12 10:04:14 +01:00
Victor Stinner 100fafcf20
bpo-39288: Add math.nextafter(x, y) (GH-17937)
Return the next floating-point value after x towards y.
2020-01-12 02:15:42 +01:00
Dong-hee Na 1b335ae281 bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)
nntplib.NNTP and nntplib.NNTP_SSL now raise a ValueError
if the given timeout for their constructor is zero to
prevent the creation of a non-blocking socket.
2020-01-11 18:39:15 +01:00
Dong-hee Na c39b52f152 bpo-39259: poplib now rejects timeout = 0 (GH-17912)
poplib.POP3 and poplib.POP3_SSL now raise a ValueError
if the given timeout for their constructor is zero to
prevent the creation of a non-blocking socket.
2020-01-10 15:34:05 +01:00
Petr Viktorin 6c5d661342 bpo-39161: Document multi-phase init modules under Py_NewInterpreter() (GH-17896)
\+ this also adds a stronger warning against sharing objects between (sub-)interpreters.



https://bugs.python.org/issue39161
2020-01-09 04:05:18 -08:00
An Long 5907e61a8d bpo-35292: Avoid calling mimetypes.init when http.server is imported (GH-17822) 2020-01-08 10:28:14 -08:00
Dong-hee Na 2e6a8efa83 bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903) 2020-01-08 16:29:34 +01:00
Pablo Galindo 9a669d58e8 bpo-39233: Update positional-only section in the glossary (GH-17874)
https://bugs.python.org/issue39233
2020-01-08 05:00:14 -08:00
Dong-hee Na 13a7ee8d62 bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)
imaplib.IMAP4 and imaplib.IMAP4_SSL now have an 
optional *timeout* parameter for their constructors.
Also, the imaplib.IMAP4.open() method now has an optional *timeout* parameter
with this change. The overridden methods of imaplib.IMAP4_SSL and
imaplib.IMAP4_stream were applied to this change.
2020-01-07 18:28:10 +01:00
Victor Stinner 5b23f7618d
bpo-39239: epoll.unregister() no longer ignores EBADF (GH-17882)
The select.epoll.unregister() method no longer ignores the EBADF
error.
2020-01-07 15:00:02 +01:00
Inada Naoki ca94677a62
bpo-38623: Doc: Add section for site module CLI. (GH-17858) 2020-01-07 16:58:40 +09:00
Inada Naoki f4800b8ed3
Doc: Change Python 2 status to EOL. (GH-17885) 2020-01-07 15:52:44 +09:00
YoSTEALTH 24bcefcb74 bpo-39234: `enum.auto()` default initial value as 1 (GH-17878)
Updated as Eric mentioned "By default, the initial value starts at 1"


https://bugs.python.org/issue39234



Automerge-Triggered-By: @ericvsmith
2020-01-06 14:04:43 -08:00
YoSTEALTH 2e9012a3e1 bpo-39234: Doc: `enum.auto()` incrementation value not specified. (GH-17872)
* `enum.auto()` initial value is now specified as being `1`.
2020-01-06 11:53:36 -08:00
Tal Einat d6c08db853 Minor formatting improvements and fixes to idle.rst (GH-17165) 2020-01-05 18:51:48 -05:00
Khalid Mammadov 94d9cfc4ed bpo-39130: Dict reversed was added in v3.8 so should say in the doc as well (GH-17694)
To be consistent with document layout, it should say when the feature was added.
Although it's mentioned few other places in the doc but it's not explicitly say that at that place.


https://bugs.python.org/issue39130
2020-01-05 14:39:38 -08:00
HongWeipeng abc0c4fa99 Fix the parameter list of object. _rpow_ (#GH-16477) 2020-01-05 17:20:29 -05:00
Oleg Höfling e6ae90dede Replace links in howto/pyporting.rst with sphinx references (GH-17781)
Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
2020-01-05 17:08:14 -05:00
Emmanuel Nosa E b789202cbe Add link to zlib v1.1.3 vulnerability (GH-17156) 2020-01-03 13:10:16 +01:00
Raymond Hettinger 4fcf5c12a3
bpo-39158: ast.literal_eval() doesn't support empty sets (GH-17742) 2020-01-02 22:21:18 -07:00
Benjamin Peterson 946b29ea0b
Bring Python into the next decade. (GH-17801) 2020-01-02 18:56:34 -08:00
Rafael Fontenelle 149175c6df bpo-39183: Fix formatting in library/ensurepip (GH-17787)
Remove extra space to fix formatting and avoid from splitting text in to strings.


https://bugs.python.org/issue39183
2020-01-01 14:26:33 -08:00
Jendrik Seipp 5b9077134c bpo-13601: always use line-buffering for sys.stderr (GH-17646) 2020-01-01 23:21:43 +01:00
Anthony Sottile 22424c02e5 Document CodeType.replace (GH-17776) 2020-01-01 06:11:16 +00:00
Борис Верховский 8e1f26e4f0 Minor doc fixes in urllib.parse (GH-17745) 2019-12-31 04:28:18 -08:00
Terry Jan Reedy ee9ff05ec2
bpo-34118: memoryview, range, and tuple are classes (GH-17761)
Tag memoryview, range, and tuple as classes, the same as list, etcetera, in
the library manual built-in functions list.
2019-12-30 17:16:43 -05:00
Kyle Stanley 89aa7f0ede bpo-34790: Implement deprecation of passing coroutines to asyncio.wait() (GH-16977) 2019-12-30 13:50:19 +02:00
Géry Ogam 226e6e7d43 bpo-39037: Fix lookup order of magic methods in with statement documentation (GH-17608)
* __enter__ is now looked up before __exit__ to give a more intuitive error message
* add pseudo-code equivalent for the with statement
* fix pseudo-code for the async with statement to use a finally clause
* use SUITE rather than BLOCK for consistency with the language grammar

Patch by Géry Ogam.
2019-12-30 15:24:51 +10:00
Antoine 32a12aed6d Fix typos and remove deprecated deprecation warning. (GH-17741) 2019-12-29 22:14:22 +00:00
Oleg Höfling cbd0408b54 links in importlib.metadata.rst replaced with sphinx references (GH-17730)
The importlib.metadata documentation uses hardcoded links to internal
pages. This results in minor rendering issues. This change replaces
the hardcoded links with suitable Sphinx roles.

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
2019-12-29 12:26:35 -05:00
Gurupad Hegde 6c7bb38ff2 bpo-39136: Fixed typos (GH-17720)
funtion -> function; configuraton -> configuration; defintitions -> definitions;
focusses -> focuses; necesarily -> necessarily; follwing -> following;
Excape -> Escape,
2019-12-28 17:16:02 -05:00
Batuhan Taşkaya 98f0f04b50 bpo-38731: Fix function signature of quiet in docs (GH-17719) 2019-12-28 02:53:03 +00:00
Michael Wayne Goodman 91874bb071 closes bpo-39135: Remove 'time.clock()' mention in docs. (GH17709)
`time.clock()` was removed in Python 3.8, but it was still mentioned
in the documentation for when `time.get_clock_info()` is given the
argument `'clock'`. This commit removes that mention.
2019-12-26 21:01:08 -06:00
Pablo Galindo f460eea5c5
Update what's new with the latest GC improvements (GH-17708) 2019-12-26 21:56:40 +00:00
Fabio Sangiovanni e28aff54d9 bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) (GH-17677) 2019-12-25 17:45:30 -05:00
cocoatomo 527f9de6ef Fix the miscellaneous typo (GH-17700)
A character "i" is omitted.
2019-12-25 07:39:35 -08:00
William Ayd 5c7ed7550e Minor C API documentation improvements. (GH-17696)
The added parentheses around the PyIter_Next assignment suppress the following warning which gcc throws without:
```
warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
```
The other change is a typo fix
2019-12-24 22:25:56 -06:00
Jürgen Gmach 9f9dac0a4e bpo-38914 Do not require email field in setup.py. (GH-17388)
When checking `setup.py` and when the `author` field was provided, but
the `author_email` field was missing, erroneously a warning message was
displayed that the `author_email` field is required.

The specs do not require the `author_email`field:
https://packaging.python.org/specifications/core-metadata/#author

The same is valid for `maintainer` and `maintainer_email`.

The warning message has been adjusted.

modified:   Doc/distutils/examples.rst
modified:   Lib/distutils/command/check.py


https://bugs.python.org/issue38914
2019-12-23 06:53:18 -08:00
Michael Morehouse e7b406f4e2 [typo] fix dupe in datetime.fromisoformat docs (GH-17295)
Fixes a nearly word for word duplication of a sentence that appears
earlier in the caution section of datetime.datetime.fromisoformat in
Doc/Library/datetime.rst.

No issue created as it's a trivial change.

Automerge-Triggered-By: @pganssle
2019-12-23 06:37:47 -08:00
cocoatomo 068768faf6 Add missing markup (GH-17680)
"HH", "MM" and "ffffff" are enclosed with double back quotes, but "SS" is left being bare
2019-12-22 09:46:45 -08:00
Parth Sharma f522a6ddb6 bpo-38918: Add __module__ entry for function & method type in inspect docs table (GH-17408)
Adds` __module__ ` entries for function & method types in inspect docs table.





https://bugs.python.org/issue38918
2019-12-20 11:18:33 -08:00
Jesús Cea b0d4949f1f
Doc typo (#17667) 2019-12-20 03:21:03 +01:00
Kyle Stanley f501db2b93 Add whatsnew for removal of asyncio.loop.create_datagram_endpoint()'s *reuse_address* parameter (#17595) 2019-12-16 16:50:34 -05:00
Steve Dower a76ba362c4
bpo-39041: Add GitHub Actions support (GH-17594) 2019-12-16 10:35:22 -08:00
Batuhan Taşkaya 814d687c7d bpo-38348: Extend command line options of ast parsing tool (GH-16540)
Add -i and --indent (indentation level), and --no-type-comments
(type comments) command line options to ast parsing tool.
2019-12-16 19:23:27 +01:00
Batuhan Taşkaya d587272fe3 bpo-38316: Fix co_stacksize documentation (GH-16983) 2019-12-15 23:02:47 +01:00
Michael Felt 39afa2d314 bpo-38021: Modify AIX platform_tag so it covers PEP 425 needs (GH-17303)
Provides a richer platform tag for AIX that we expect to be sufficient for PEP 425
binary distribution identification. Any backports to earlier Python versions will be
handled via setuptools.

Patch by Michael Felt.
2019-12-16 00:17:53 +10:00
Jason R. Coombs b7a0109cd2
bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568)
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints.

* 📜🤖 Added by blurb_it.

* Correct module reference
2019-12-10 20:05:10 -05:00
Sergey Fedoseev a2ff283d51 bpo-27961: Replace PY_ULLONG_MAX with ULLONG_MAX (GH-17539) 2019-12-09 21:22:19 +01:00
Steve Dower ee17e37356
bpo-39007: Add auditing events to functions in winreg (GH-17541)
Also allows winreg.CloseKey() to accept same types as other functions.
2019-12-09 11:18:12 -08:00
Steve Dower b8cbe74c34
bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a deprecation warning (GH-17540) 2019-12-09 11:05:39 -08:00
Kyle Stanley ab513a38c9 bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (#17311) 2019-12-09 15:21:10 +01:00
Victor Stinner 0131aba5ae
bpo-38916: array.array: remove fromstring() and tostring() (GH-17487)
array.array: Remove tostring() and fromstring() methods.  They were
aliases to tobytes() and frombytes(), deprecated since Python 3.2.
2019-12-09 14:09:14 +01:00
Victor Stinner 6cac113666
bpo-38991: Remove test.support.strip_python_stderr() (GH-17490)
test.support: run_python_until_end(), assert_python_ok() and
assert_python_failure() functions no longer strip whitespaces from
stderr.
2019-12-08 08:38:16 +01:00
Christian Heimes 2b7de6696b bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

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


https://bugs.python.org/issue38820
2019-12-07 08:59:36 -08:00
Daniel Himmelstein 15fb7fa881 bpo-29636: json.tool: Add document for indentation options. (GH-17482)
And updated test to use subprocess.run
2019-12-07 23:14:40 +09:00
Anj-A 4443450fda bpo-38652: Remove provisional note for asyncio.BufferedProtocol (GH-17047)
https://bugs.python.org/issue38652
2019-12-07 04:53:12 -08:00
wim glenn efefe25443 bpo-27413: json.tool: Add --no-ensure-ascii option. (GH-17472) 2019-12-06 15:44:01 +09:00
Sergey Fedoseev 1f9f69dd4c bpo-27961: Replace PY_LLONG_MAX, PY_LLONG_MIN and PY_ULLONG_MAX with standard macros (GH-15385)
Use standard constants LLONG_MIN, LLONG_MAX and ULLONG_MAX.
2019-12-05 15:55:28 +01:00
An Long eb48a451e3 bpo-27873: Update docstring for multiprocessing.Pool.map (GH-17436)
Update docstring for `multiprocessing.Pool.map` to mention `pool.starmap()`.

Prev PR: https://github.com/python/cpython/pull/17367  @aeros


https://bugs.python.org/issue27873
2019-12-03 15:30:53 -08:00
idomic fdafa1d0ed document threading.Lock.locked() (GH-17427) 2019-12-01 22:07:39 +02:00
Ofek Lev 575d0b46d1 Fix typos (GH-17423) 2019-11-30 21:44:21 -08:00
Steve Dower bea33f5e1d
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are invoked (GH-17392)
Also fixes some potential segfaults in unraisable hook handling.
2019-11-28 08:46:11 -08:00
Tal Einat 02519f75d1
bpo-38524: clarify example a bit and improve formatting (GH-17406) 2019-11-28 07:22:09 +02:00
Tzu-ping Chung 045d4e243d bpo-38928: Fix versionadded for venv's upgrade_deps function (GH-17404) 2019-11-27 20:21:48 +00:00
Inada Naoki ea9835c5d1
bpo-26730: Fix SpooledTemporaryFile data corruption (GH-17400)
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
2019-11-27 22:22:06 +09:00
Florian Dahlitz 1bddf890e5 bpo-38524: document implicit and explicit calling of descriptors' __set_name__ (GH-17364) 2019-11-27 10:46:40 +02:00
Yoni Lavi ce4b7a273a Show the differing module names for readlink() (GH-17395)
This was very confusing with the text for both being just `readlink()`.
2019-11-26 21:08:50 -08:00
Terry Jan Reedy e563a155be bpo-38892: Improve docs for audit event (GH-17361) 2019-11-26 09:07:48 -08:00
Karl Dubost bc441ed7c1 bpo-22377: Fixes documentation for %Z in datetime (GH-16507)
This fixes the issue discussed in https://bugs.python.org/issue22377
and fixes it according to the comments made by Paul Ganssle @pganssle

* It clarifies which values are acceptable in the table
* It extends the note with a clearer information on the valid values


https://bugs.python.org/issue22377
2019-11-26 08:38:41 -08:00
David Coles 386d00cc34 Remove use of deprecated `array.fromstring` method (GH-17332) 2019-11-26 15:31:09 +09:00
Sanchit Khurana f8a6316778 bpo-21063: Improve module synopsis for distutils (GH-17363) 2019-11-25 14:17:59 -08:00
Pablo Galindo e11f25dbd8
Fix typo in Doc/whatsnew/3.9.rst (GH-17372) 2019-11-25 11:16:39 +00:00
Pablo Galindo 27fc3b6f3f
bpo-38870: Expose a function to unparse an ast object in the ast module (GH-17302)
Add ast.unparse() as a function in the ast module that can be used to unparse an
ast.AST object and produce a string with code that would produce an equivalent ast.AST
object when parsed.
2019-11-24 23:02:40 +00:00
Terry Jan Reedy 6bf644ec82
bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366)
Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
2019-11-24 16:29:29 -05:00
Raymond Hettinger 041d8b48a2
bpo-38881: choices() raises ValueError when all weights are zero (GH-17362) 2019-11-23 02:22:13 -08:00
Brett Cannon 84b1ff6560 bpo-38899: virtual environment activation for fish should use `source` (GH-17359)
The previously documented use of `.` is considered deprecated (https://fishshell.com/docs/current/commands.html#source).


https://bugs.python.org/issue38899



Automerge-Triggered-By: @brettcannon
2019-11-22 23:32:27 -08:00
Victor Stinner d68b592dd6
bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)
Remove PyUnicode_ClearFreeList() function: the Unicode free list has
been removed in Python 3.3.
2019-11-23 02:30:32 +01:00
Victor Stinner 2582d46fbc
bpo-38858: new_interpreter() reuses pycore_init_builtins() (GH-17351)
new_interpreter() now calls _PyBuiltin_Init() to create the builtins
module and calls _PyImport_FixupBuiltin(), rather than using
_PyImport_FindBuiltin(tstate, "builtins").

pycore_init_builtins() is now responsible to initialize
intepr->builtins_copy: inline _PyImport_Init() and remove this
function.
2019-11-22 19:24:49 +01:00
Callum Ward 42bc60ead3 closes bpo-29275: Remove Y2K reference from time module docs (GH-17321)
The Y2K reference is not needed as it only points out that Python's use
of C standard functions doesn't generally suffer from Y2K issues; the
point regarding conventions for conversion of 2-digit years in
:func:`strptime` is still valid.
2019-11-22 08:57:14 -08:00
Alex 4e205b74f9 Fix quoted signature of setattrofunc (GH-17251)
setattrofunc returns `int`, not `PyObject *`.
2019-11-22 14:48:14 +01:00
Claudiu Popa 65444cf7fe bpo-38526: Fix zipfile.Path method name to be the correct one (#17317) 2019-11-21 16:23:13 -05:00
Mark Shannon 82f897bf8f
Correct release version to 3.9 for RERAISE and WITH_EXCEPT_START bytecodes. (#17318)
bpo-33387

Corrects commit fee5526
2019-11-21 14:47:49 +00:00
Mark Shannon fee552669f
Produce cleaner bytecode for 'with' and 'async with' by generating separate code for normal and exceptional paths. (#6641)
Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication.
Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
2019-11-21 09:11:43 +00:00
Géry Ogam d67279147a Update functions.rst (GH-16468)
This PR will make the following changes to the [_Built-in Functions_](https://docs.python.org/3/library/functions.html) chapter of the library documentation:

- improve hyperlinks in Sphinx roles (trailing 's' belong to hyperlinks).

Automerge-Triggered-By: @csabella
2019-11-20 18:10:19 -08:00
Dave Nguyen 9391f6c3ef bpo-36277: Add document for pdb debug and retval commands (GH-12872)
https://bugs.python.org/issue36277



Automerge-Triggered-By: @csabella
2019-11-20 17:49:15 -08:00
Jules Lasne (jlasne) 6db2fb7c30 Removed capital letter in parameter in stdtypes.rst (GH-17218)
Automerge-Triggered-By: @csabella
2019-11-20 17:30:05 -08:00
Aveheuzed 06ca2a2be9 Fixed an incorrect sentence in the docs (GH-17205)
Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on
while translating the file.

skip issue

Automerge-Triggered-By: @csabella
2019-11-20 17:19:00 -08:00
Jason Fried 046442d02b bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) 2019-11-20 16:27:51 -08:00
Victor Stinner 4dedd0f0dd
bpo-37340: Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList() (GH-17284)
Remove PyMethod_ClearFreeList() and PyCFunction_ClearFreeList()
functions: the free lists of bound method objects have been removed.

Remove also _PyMethod_Fini() and _PyCFunction_Fini() functions.
2019-11-20 12:59:12 +01:00
Victor Stinner 488d02a241
bpo-38835: Exclude PyFPE macros from the stable API (GH-17228)
Exclude PyFPE_START_PROTECT() and PyFPE_END_PROTECT() macros of
pyfpe.h from Py_LIMITED_API (stable API).
2019-11-20 12:17:09 +01:00
Benjamin Peterson 7483451577
closes bpo-38712: Add signal.pidfd_send_signal. (GH-17070)
This exposes a Linux-specific syscall for sending a signal to a process
identified by a file descriptor rather than a pid.

For simplicity, we don't support the siginfo_t parameter to the syscall. This
parameter allows implementing a pidfd version of rt_sigqueueinfo(2), which
Python also doesn't support.
2019-11-19 20:39:14 -08:00
John Belmonte 279d8df5e5 bpo-38753: AsyncMock added in version 3.8 (GH-17102) 2019-11-19 16:30:43 -08:00
Jules Lasne (jlasne) f25875af42 Added missing coma after end of list in subprocess.rst (GH-17217)
Automerge-Triggered-By: @csabella
2019-11-19 04:14:53 -08:00
Jules Lasne (jlasne) b1f160a236 Add missing comma and period in unittest docs (GH-17211)
Automerge-Triggered-By: @csabella
2019-11-19 04:05:45 -08:00
Batuhan Taşkaya 24555ce2f9 bpo-21767: explicitly mention abc support in functools.singledispatch docs (#17171) 2019-11-19 09:16:46 +01:00
Steve Dower 00923c6399
bpo-38622: Add missing audit events for ctypes module (GH-17158) 2019-11-18 11:32:46 -08:00
Роман Донченко f49f6baa6b Correct the description of the 3.7 change in urllib.parse.quote (GH-17065)
`~` is now treated as an unreserved character (i.e. it doesn't get quoted), not a reserved one.
2019-11-18 07:30:53 -08:00
Vinay Sajip 5383956583
bpo-38830: Correct slot signature in Qt example. (GH-17220) 2019-11-18 12:03:22 +00:00
Raymond Hettinger 04c79d6088
bpo-38678: Improve argparse example in tutorial (GH-17207) 2019-11-17 22:06:19 -08:00
alclarks 4544e78ec4 bpo-25866: Minor cleanups to "sequence" in docs (GH-17177) 2019-11-17 14:00:43 -08:00
Serhiy Storchaka a0652328a2
bpo-28286: Deprecate opening GzipFile for writing implicitly. (GH-16417)
Always specify the mode argument for writing.
2019-11-16 18:56:57 +02:00
Serhiy Storchaka bd44a7ead9
bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005)
Make it a constant and referring to a constant string.
2019-11-16 18:55:29 +02:00
Jules Lasne (jlasne) 0fe0b88d6e Updated missing periods in cmdline.rst (GH-17173) 2019-11-15 23:18:17 +01:00
HongWeipeng 84f2528d48 Fix the description of isdatadescriptor in inspect.rst (#16645) 2019-11-15 23:47:26 +02:00
Eric Snow 73cdb0c6b2 bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)
The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime.  This change adds some more information on the subject.


https://bugs.python.org/issue38816
2019-11-15 13:28:54 -08:00
Phil Connell b22030073b bpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)
Small docs update for [bpo-34651](https://bugs.python.org/issue34651).

Other references to fork (e.g. the PyOS.*Fork functions or discussions of fork() when embedding Python) point back to os.fork, so I don't think any other updates are needed.





https://bugs.python.org/issue38778



Automerge-Triggered-By: @ericsnowcurrently
2019-11-15 08:56:03 -08:00
Andrey Doroschenko e8acc865a3 bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162) 2019-11-15 11:03:46 +02:00
Benjamin Peterson 3ccdd9b180
closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069) 2019-11-13 19:08:50 -08:00
Shu 2d56af7a94 Fix minor typos. (GH-17095) 2019-11-12 19:12:11 -08:00
Serhiy Storchaka 138ccbb022
bpo-38738: Fix formatting of True and False. (GH-17083)
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
2019-11-12 16:57:03 +02:00
Jeroen Demeyer 9a13a388f2 bpo-36974: expand call protocol documentation (GH-13844)
CC @encukou 

I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section.


https://bugs.python.org/issue36974



Automerge-Triggered-By: @encukou

Automerge-Triggered-By: @encukou
2019-11-12 05:08:00 -08:00
David K a12255d8de bpo-38421: Update email.utils documentation (GH-16678)
Updates documentation around email.utils.parsedate_tz().

Currently, the documentation specifies that when a string without a is timezone passed to parsedate_tz(), the last tuple is returned as ```None```.

This is no longer true since Python 3.3


https://bugs.python.org/issue38421
2019-11-12 04:38:46 -08:00
Raymond Hettinger 733b9a308e
bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111) 2019-11-11 23:35:06 -08:00
Manjusaka 051ff526b5 bpo-38565: add new cache_parameters method for lru_cache (GH-16916) 2019-11-11 23:30:18 -08:00
Jonathan Scholbach 98480cef9d bpo-38771: Explict test for None in code example (GH-17108) 2019-11-11 16:49:41 -08:00
Brandt Bucher a0ed99bca8 bpo-38438: Simplify argparse "star nargs" usage. (GH-17106) 2019-11-11 12:47:48 -08:00
Shu fc6b1bf869 Clarify amount of dots between package and subpackage (GH-17092) 2019-11-08 12:26:35 -08:00
Victor Stinner d12d0e7c0f
bpo-38733: PyErr_Occurred() caller must hold the GIL (GH-17080)
bpo-3605, bpo-38733: Optimize _PyErr_Occurred(): remove "tstate ==
NULL" test.

Py_FatalError() no longer calls PyErr_Occurred() if called without
holding the GIL. So PyErr_Occurred() no longer has to support
tstate==NULL case.

_Py_CheckFunctionResult(): use directly _PyErr_Occurred() to avoid
explicit "!= NULL" test.
2019-11-07 12:42:07 +01:00
Raymond Hettinger 7f460494d2
bpo-38382: Document the early-out behavior for a zero (GH-17037) 2019-11-06 21:50:44 -08:00
Benjamin Peterson 5c0c325453 closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)
https://bugs.python.org/issue38713
2019-11-05 21:58:31 -08:00
Benjamin Peterson 6c4c45efae
bpo-38692: Add os.pidfd_open. (GH-17063) 2019-11-05 19:21:29 -08:00
Ammar Askar 56698d5769 bpo-38696: Fix usage example of HTTPStatus (GH-17066) 2019-11-05 17:29:33 -06:00
Jeroen Demeyer bf17d41826 bpo-37645: add new function _PyObject_FunctionStr() (GH-14890)
Additional note: the `method_check_args` function in `Objects/descrobject.c` is written in such a way that it applies to all kinds of descriptors. In particular, a future re-implementation of `wrapper_descriptor` could use that code.

CC @vstinner @encukou 


https://bugs.python.org/issue37645



Automerge-Triggered-By: @encukou
2019-11-05 07:48:04 -08:00
Jules Lasne (jlasne) 5e01a6542a Update interpreter.rst (GH-17059)
Fixed what seemed to be a weird phrasing.
2019-11-05 14:20:38 +01:00
Victor Stinner f4b1e3d7c6
bpo-38644: Add Py_EnterRecursiveCall() to the limited API (GH-17046)
Provide Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() as
regular functions for the limited API. Previously, there were defined
as macros, but these macros didn't work with the limited API which
cannot access PyThreadState.recursion_depth field.

Remove _Py_CheckRecursionLimit from the stable ABI.

Add Include/cpython/ceval.h header file.
2019-11-04 19:48:34 +01:00
Raymond Hettinger 1cdadf414b
bpo-37759: Show output from var_access_benchmark (GH-17040) 2019-11-03 21:47:01 -08:00
Dima Tisnek d0e0f5bf0c bpo-38388: Document pickle protocol version 5 (GH-16639) 2019-11-03 13:55:33 +02:00
Борис Верховский 99b7701978 Convert argument to snake_case (GH-16990) 2019-11-02 12:09:14 -07:00
Jon Janzen d0d9f7cfa3 Slightly improve plistlib test coverage. (GH-17025)
* Add missing test class (mistake in GH-4455)

* Increase coverage with 4 more test cases

* Rename neg_uid to huge_uid in test_modified_uid_huge

* Replace test_main() with unittest.main()

* Update plistlib docs
2019-11-01 18:45:01 +02:00
Petr Viktorin 9bc94eca0c
bpo-38159: Clarify documentation of PyState_AddModule (GH-16101)
This was never intented to be called manually from PyInit_*.

Also, clarify PyState_RemoveModule return value.
2019-11-01 16:47:05 +01:00
Simon Legner 112f2b805b Update the URL for the requests package (GH-17006)
Change the url from docs.python-requests.org to requests.readthedocs.io
2019-10-31 05:01:44 -07:00
Anthony Sottile b32cb97bce bpo-38312: Add curses.{get,set}_escdelay and curses.{get,set}_tabsize. (GH-16938) 2019-10-31 11:13:48 +02:00
Serhiy Storchaka e835b31d2b
bpo-38600: NULL -> ``NULL``. (GH-17001)
Also fix some other formatting.
2019-10-30 21:37:16 +02:00
Victor Stinner 24c6258269
bpo-38614: Add timeout constants to test.support (GH-16964)
Add timeout constants to test.support:

* LOOPBACK_TIMEOUT
* INTERNET_TIMEOUT
* SHORT_TIMEOUT
* LONG_TIMEOUT
2019-10-30 12:41:43 +01:00
Serhiy Storchaka 865c3b257f
bpo-28029: Make "".replace("", s, n) returning s for any n != 0. (GH-16981) 2019-10-30 12:03:53 +02:00
Serhiy Storchaka 25fc088607
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
Replace all *NULL* with ``NULL``.
2019-10-30 12:03:20 +02:00
Géry Ogam 4c155f738d bpo-38336: Remove the __set__ method restriction on data descriptors for attribute lookup precedence (GH-16520) 2019-10-29 00:04:01 -07:00
Kyle Stanley 457306bddb Fix asyncio.wait() 3.8 whatsnew entry (GH-16975) 2019-10-28 21:53:22 -04:00
benedwards14 794616f837 bpo-38534: Replace wrong KB number references (GH-16955) 2019-10-28 10:53:51 -07:00
Victor Stinner e471e72977
bpo-37330: open() no longer accept 'U' in file mode (GH-16959)
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
2019-10-28 15:40:08 +01:00
Dong-hee Na 3bfc8e0fcc bpo-38602: Add fcntl.F_OFD_XXXX for fcntlmodule (GH-16956) 2019-10-28 09:31:15 +02:00
Marco Rougeth 85c6f8c65c bpo-38592 Add pt-br switcher to Python Docs website (GH-16924)
* 📜🤖 Added by blurb_it.
2019-10-27 09:30:12 +01:00
Steve Dower 894e30ce0b
bpo-38434: Fixes some audit event documentation (GH-16932) 2019-10-26 13:02:30 -07:00
Serhiy Storchaka d898d20e8c
bpo-38557: Improve documentation for list and tuple C API. (GH-16925) 2019-10-26 22:59:18 +03:00
Ammar Askar cb2cf06b0a bpo-38558: Mention `:=` in conditions tutorial (GH-16919) 2019-10-25 17:20:05 -05:00
Kyle Stanley 3bbb6db545 Add missing asyncio changes from 3.8 whatsnew (GH-16911) 2019-10-24 00:15:25 -04:00
Girts a01ba333af bpo-30618: add readlink to pathlib.Path (GH-8285)
This adds a "readlink" method to pathlib.Path objects that calls through
to os.readlink.


https://bugs.python.org/issue30618



Automerge-Triggered-By: @gpshead
2019-10-23 14:18:40 -07:00
Peter Bittner d34ac30532 Spell Bitbucket correctly. (GH-16862) 2019-10-23 12:17:30 +03:00
Daniel Baskal 91528f40c3 bpo-38466: Fix threading.excepthook doc (GH-16891) 2019-10-22 22:37:47 +02:00
Julien Palard c987090c73
Bump Sphinx to 2.2.0. (GH-16532) 2019-10-22 18:13:41 +02:00
Kyle Stanley dfe726b1ac Fix Zope URL (GH-16880) 2019-10-22 05:43:10 -04:00
Dong-hee Na 2eba6ad7bf bpo-38493: Add os.CLD_KILLED and os.CLD_STOPPED. (GH-16821) 2019-10-21 10:01:05 +03:00
Batuhan Taşkaya 74142078b3 bpo-38531: document extend action's added version (GH-16865) 2019-10-20 13:13:54 -07:00
Raymond Hettinger c93883c6af
bpo-37759: More updates to Whatsnew 3.8 (GH-16854)
* math.perm() and math.comb()

* math.isqrt()

* Add singledispatchmethod()

* itertools.accumulate()

* Optional headers for xmlrpc.client.ServerProxy

* IDLE non-BMP characters

* import collections.abc directly

* @coroutine is deprecated

* pprint.pp()

* New options for object.__reduce__()

* DictReader no longer returns OrderedDicts

* "force" option for logging.basicConfig()

* Fix spelling

* cProfile context manager

* Various markup/grammar fixes from Kyle Stanley.
Other minor fixes as well.
Also, dedup the __reduce__ entry.

* Fix markup

* Fix grammar nits found by MS Word
2019-10-20 11:25:16 -07:00
Jon Dufresne 88eeda6311 Remove doc reference to unmaitained Nose package (GH-16849)
The Nose package is no longer maintained.
2019-10-19 12:22:20 -07:00
Jero Bado b1fa72a5b7 Fix minor typos in What's New in Python 3.8. (GH-16770)
Added periods at the end of the sentences.
2019-10-18 10:48:48 +03:00
Stéphane Wirtel 93b81e1fcb
Doc: Add missing entry for functools.cached_property (GH-16803) 2019-10-18 09:14:18 +02:00
Gregory P. Smith f33c57d5c7
bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)
Also updates the documentation to clarify the situation surrounding
the digestmod parameter that is required despite its position in the
argument list as of 3.8.0 as well as removing old python2 era
references to "binary strings".

We indavertently had this raise ValueError in 3.8.0 for the missing
arg.  This is not considered an API change as no reasonable code would
be catching this missing argument error in order to handle it.
2019-10-17 20:30:42 -07:00
Ned Deily 3f36043db2
Update doc switcher list for 3.8.0 (GH-16809) 2019-10-15 17:26:05 -04:00
Julien Danjou 8d59eb1b66 bpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545)
Add a total_nframe field to the traces collected by the tracemalloc module.
This field indicates the original number of frames before it was truncated.
2019-10-15 14:00:16 +02:00
Steve Dower 4d202281c1
bpo-38133: Update docs to reflect fixes to py.exe launcher (GH-16791) 2019-10-14 15:45:43 -07:00
Julien Palard 4504b4500d Doc: 3.8 is now stable. (GH-16790) 2019-10-14 18:13:38 -04:00
Raymond Hettinger 274bd013da
Remove draft status. Add asyncio REPL example (GH-16785) 2019-10-14 09:01:05 -07:00
Serhiy Storchaka 298439ce3f bpo-37759: Polish What's New in Python 3.8. (#16769) 2019-10-14 15:10:40 +02:00
Stein Karlsen aad2ee0156 bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768) 2019-10-14 13:36:29 +03:00
Raymond Hettinger a3291531ea
bpo-37759: Add examples for the new typing features (GH-16763) 2019-10-13 23:32:03 -07:00
Raymond Hettinger 61a6db5e79
bpo-38461 and bpo-38463: Minor fixes to Whatsnew 3.8 (GH-16761)
* bpo-38461: ncurses misspelled as curses

* bpo-38463: Fix broken link
2019-10-13 21:31:12 -07:00
Raymond Hettinger 8a6cbf8adb
bpo-38464: Document parameter for NormalDist.quantiles() (GH-16757) 2019-10-13 19:53:30 -07:00
Sebastian Rittau fdfe2833ac bpo-38467: Fix argument name of typing functions (GH-16753) 2019-10-13 19:31:35 +01:00
Ivan Levkivskyi 8144095707 bpo-28556: Remove another mention of metaclass of Generic in typing docs (GH-16743)
Metaclass was removed in Python 3.7 (there is already a `versionchanged` item about this).


https://bugs.python.org/issue28556
2019-10-13 09:53:06 -07:00
Andrew Kuchling bb78f6cfa6
Rebased version of what's new PR (#16745)
* Use Unicode character for accent
* Various grammar fixes
* Sort library modules alphabetically; remove duplicated idlelib/IDLE section
2019-10-13 11:51:36 -04:00
Serhiy Storchaka 140a7d1f35
bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
They conflicted with keyword "in".

Also rename positional-only parameters of private os._fcopyfile()
for consistency.
2019-10-13 11:59:31 +03:00
Gregory P. Smith f3751efb5c
bpo-38417: Add umask support to subprocess (GH-16726)
On POSIX systems, allow the umask to be set in the child process before we exec.
2019-10-12 13:24:56 -07:00
Hugo van Kemenade 547c60c96e Fix minor typos in Whatsnew 2019-10-12 10:53:36 -07:00
Phil Jones e634da2747 Announce the change in the CancelledError inheritance (GH-16730)
This is a fairly noticeable change that requires adjustments in
existing asyncio code. It should therefore be announced.
2019-10-12 13:46:13 -04:00
Samuel Colvin 822922af90 bpo-35800: Deprecate smtpd.MailmanProxy (GH-11675)
Since `smtpd.MailmanProxy` is already broken, it is not formally deprecated in 3.9. It will be removed in 3.10.


https://bugs.python.org/issue35800
2019-10-12 10:24:26 -07:00
Serhiy Storchaka cbb548130c
bpo-38442: Remove an execution bit from Doc/whatsnew/3.8.rst. (GH-16715) 2019-10-11 11:44:42 +03:00
Kyle Stanley f900064ac4 docs: Add asyncio source code links (GH-16640) 2019-10-10 19:18:46 -04:00
M. Eric Irrgang d47f0dd2e8 bpo-32996: Documentation fix-up. (GH-16646)
PR #4906 changed the typing.Generic class hierarchy, leaving an
outdated comment in the library reference. User-defined Generic ABCs now
must get a abc.ABCMeta metaclass from something other than typing.Generic
inheritance.
2019-10-10 12:11:33 +01:00
Serhiy Storchaka d05b000c6b
bpo-38371: Tkinter: deprecate the split() method. (GH-16584) 2019-10-08 14:31:35 +03:00
Ricardo Bánffy 15ae75d660 bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)
Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
2019-10-07 23:54:35 +03:00
Krishna Oza 038503e08a bpo-38391: Fixing a typo for Py_DECREF (GH-16616) 2019-10-07 19:57:45 +08:00
Serhiy Storchaka ef092fe990
bpo-25988: Do not expose abstract collection classes in the collections module. (GH-10596) 2019-10-07 12:10:15 +03:00
Adam J. Stewart 9e71917e02 bpo-26510: Add versionchanged for required arg of add_subparsers (GH-16588)
The `required` argument to `argparse.add_subparsers` was added in #3027. This PR specifies the earliest version of Python where it is available.


https://bugs.python.org/issue26510



Automerge-Triggered-By: @merwok
2019-10-06 19:08:48 -07:00
Joannah Nanjekye 8855e47d09 bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal (GH-16558)
Revert the removal of PyThreadState_DeleteCurrent() with documentation.
2019-10-04 13:35:42 +02:00
Ashley Whetter 3142c667b5 bpo-38235: Correct some arguments names in logging documentation (GH-16571) 2019-10-04 08:55:14 +01:00
Victor Stinner 8462a4936b
bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)
PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
2019-10-01 12:06:16 +02:00
Victor Stinner 3c30a76f3d
bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.

We may revisit this in the future if we further explore the idea of offering a stable embedding API.

(cherry picked from commit bdace21b76)
2019-10-01 10:56:37 +02:00
Maxwell A McKinnon cf57cabef8 bpo-32689: Updates shutil.move to allow for Path objects to be used as source arg (GH-15326)
Important work originally done by @emilyemorehouse two years ago and nearly ready to go in.

This bug has affected many people and in some cases has been a dealbreaker to the adoption of the otherwise wonderful pathlib and PEP519. https://stackoverflow.com/questions/33625931/copy-file-with-pathlib-in-python.

This adds the outstanding test request from that PR @vstinner (https://github.com/python/cpython/pull/5393).

Test fails without the change, passes with it, along with every other test in test_shutil.

Some variants were experimented with to make the one line change and the most performant one was picked.


# Added Test for PathLike directory destination, the current fail case

```
Lib/test/test_shutil.py::TestMove::test_move_file_pathlike FAILED                                                               [100%]

============================================================== FAILURES ===============================================================
__________________________________________________ TestMove.test_move_file_pathlike ___________________________________________________

self = <test.test_shutil.TestMove testMethod=test_move_file_pathlike>

    def test_move_file_pathlike(self):
        # Move a file to another location on the same filesystem.
        src = pathlib.Path(self.src_file)
>       self._check_move_file(src, self.dst_dir, self.dst_file)

Lib/test/test_shutil.py:1563:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Lib/test/test_shutil.py:1545: in _check_move_file
    shutil.move(src, dst)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py:562: in move
    real_dst = os.path.join(dst, _basename(src))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

path = PosixPath('/var/folders/r2/psq74t5x3nbfzlph8bh2pvdw0000gn/T/tmp9ie0wh9_/foo')

    def _basename(path):
        # A basename() variant which first strips the trailing slash, if present.
        # Thus we always get the last component of the path, even for directories.
        sep = os.path.sep + (os.path.altsep or '')
>       return os.path.basename(path.rstrip(sep))
E       AttributeError: 'PosixPath' object has no attribute 'rstrip'

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py:526: AttributeError
============================================== 1 failed, 102 deselected in 0.30 seconds ===============================================
```

After change:

```
========================================================= test session starts =========================================================
platform darwin -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- /Users/maxwellmckinnon/.venvs/TA3.7/bin/python3.7
cachedir: .pytest_cache
rootdir: /Users/maxwellmckinnon/dev/cpython
plugins: cov-2.7.1, mock-1.10.4
collected 103 items / 102 deselected / 1 selected

Lib/test/test_shutil.py::TestMove::test_move_file_pathlike PASSED                                                               [100%]

============================================== 1 passed, 102 deselected in 0.06 seconds ===============================================
```

Running all the tests in test_shutil.py
```
╰─ pytest Lib/test/test_shutil.py -v
========================================================= test session starts =========================================================
platform darwin -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- /Users/maxwellmckinnon/.venvs/TA3.7/bin/python3.7
cachedir: .pytest_cache
rootdir: /Users/maxwellmckinnon/dev/cpython
plugins: cov-2.7.1, mock-1.10.4
collected 103 items

Lib/test/test_shutil.py::TestShutil::test_chown PASSED                                                                          [  0%]
Lib/test/test_shutil.py::TestShutil::test_copy PASSED                                                                           [  1%]
...
Lib/test/test_shutil.py::TermsizeTests::test_stty_match SKIPPED                                                                 [ 99%]
Lib/test/test_shutil.py::PublicAPITests::test_module_all_attribute PASSED                                                       [100%]

================================================ 96 passed, 7 skipped in 1.25 seconds =================================================
```

# Performance Considerations
Is it considered poor form to get rid of _basename altogether and make use of pathlib in the move function? I'm not sure if the idea is for all these modules to strictly avoid circular dependencies. They are already using os.path which is just as much a citizen in 3.8 as pathlib right?

e.g.

`real_dst = os.path.join(dst, _basename(src))`
becomes
`real_dst = Path(dst) / Path(src).name`

I've looked around and familiarized myself, and I now think importing pathlib here is fine. My only remaining concern is that of performance.

Here's the performance difference for this step. 

```
In [46]: %timeit real_dst = os.path.join("a/b/c", _basename('b/'))
2.71 µs ± 62.6 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

In [47]: %timeit real_dst = Path("a/b/c") / Path('b/').name
12.4 µs ± 65.3 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)
```

Is 10us significant or insignificant compared to the least expensive operation this function will do? I don't know. Let's find out.

```
In [55]: %timeit os.rename('/tmp/a/a.txt', '/tmp/a/b.txt'); os.rename('/tmp/a/b.txt', '/tmp/a/a.txt')
124 µs ± 2.18 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
```
62us to rename. 10us seems significant enough that we wouldn't want to favor the Path sugar suggestion. 16% speed decrease from adding the 10us.

What do people think? I was hoping to get to use pathlib.Path here, but I suspect for this low level move, it should be as fast as possible, and 16% is not worth one line of sugary code to me.



https://bugs.python.org/issue32689



Automerge-Triggered-By: @gvanrossum
2019-09-30 19:41:16 -07:00
Kyle Stanley e407013089 Fix and improve `asyncio.run()` docs (GH-16403) 2019-09-30 17:12:21 -07:00
Yury Selivanov 6758e6e12a
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
See https://bugs.python.org/issue38242 for more details
2019-09-29 21:59:55 -07:00
Lisa Roach 3667e1ee6c
bpo-38163: Child mocks detect their type as sync or async (GH-16471) 2019-09-29 21:56:47 -07:00
Victor Stinner fb4ae152a9
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.

* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
  with "_Py".
* test_embed: add test_init_warnoptions().
2019-09-30 01:40:17 +02:00
Pascal Chambon c5a7e0ce19 bpo-37408: Precise that Tarfile "format" argument only concerns writing. (GH-14389) 2019-09-28 08:04:44 -07:00
Victor Stinner 441b10cf28
bpo-38304: Add PyConfig.struct_size (GH-16451)
Add a new struct_size field to PyPreConfig and PyConfig structures to
allow to modify these structures in the future without breaking the
backward compatibility.

* Replace private _config_version field with public struct_size field
  in PyPreConfig and PyConfig.
* Public PyPreConfig_InitIsolatedConfig() and
  PyPreConfig_InitPythonConfig()
  return type becomes PyStatus, instead of void.
* Internal _PyConfig_InitCompatConfig(),
  _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(),
  _PyPreConfig_InitFromPreConfig() return type becomes PyStatus,
  instead of void.
* Remove _Py_CONFIG_VERSION
* Update the Initialization Configuration documentation.
2019-09-28 04:28:35 +02:00
bariod dd6117c6d7 Fix typo in the "Porting to Python 3.8" section. (GH-16435) 2019-09-27 21:01:33 +03:00
Ammar Askar 5faff977ad bpo-38206: Clarify tp_dealloc requirements for heap allocated types. (GH-16248)
As mentioned in the bpo ticket, this mistake came up on two reviews:
- https://github.com/python/cpython/pull/16127#pullrequestreview-288312751
- https://github.com/python/cpython/pull/16071#pullrequestreview-287819525

Would be nice to have it documented in a more permanent place than 3.8's whatsnew entry.


https://bugs.python.org/issue38206



Automerge-Triggered-By: @encukou
2019-09-27 04:11:27 -07:00
Prateek Nayak a7414571a1 bpo-38244: [Documentation] Fix unreliable link to sever in ftplib.rst (#16319) 2019-09-26 17:22:31 +08:00
Mohammad Dehghan 1ad7be2f16 bpo-38130: Fix error in explaining when an exception is re-raised (GH-16016)
Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
2019-09-26 11:09:05 +02:00
Kyle Stanley 6a10d59541 Doc: Several fixes and improvements for 3.9 whatsnew (GH-16375) 2019-09-26 09:06:46 +02:00
Stéphane Wirtel 5d326abf2c
Doc: Use the `with` statement in the first example of the ftplib doc. (GH-16271) 2019-09-26 09:01:18 +02:00
Lumír 'Frenzy' Balhar 8e7bb991de bpo-38112: Compileall improvements (GH-16012)
* Raise the limit of maximum path depth to actual  recursion limit

* Add posibilities to adjust a path compiled in .pyc  file.

Now, you can:
- Strip a part of path from a beggining of path into compiled file
   example "-s /test /test/build/real/test.py" → "build/real/test.py"
- Append some new path to a beggining of path into compiled file
   example "-p /boo real/test.py" → "/boo/real/test.py"

You can also use both options in the same time. In that case,
striping is done before appending.

* Add a possibility to specify multiple optimization levels

Each optimization level then leads to separated compiled file.
Use `action='append'` instead of `nargs='+'` for the -o option.
Instead of `-o 0 1 2`, specify `-o 0 -o 1 -o 2`. It's more to type,
but much more explicit.

* Add a symlinks limitation feature

This feature allows us to limit byte-compilation of symbolic
links if they are pointing outside specified dir (build root
for example).
2019-09-26 08:28:26 +02:00
Victor Stinner 88feaecd46
bpo-38234: Complete init config documentation (GH-16404) 2019-09-26 03:15:07 +02:00
Victor Stinner 8bf39b606e
bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)
* Add test_embed.test_init_setpath_config(): test Py_SetPath()
  with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
  Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import  and base_executable
  fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
  calculated base_executable: _PyConfig_InitPathConfig() copies
  executable to base_executable.
* Complete path config documentation.
2019-09-26 02:22:35 +02:00
Raymond Hettinger 15ccc4fac0
bpo-38255: super() can search attributes as well as methods (GH-16368)
Improvement suggested by Géry Ogam.
2019-09-25 08:13:19 -07:00
Petr Viktorin 468f8a6ee0
bpo-38140: Document offsets in PyMemberDef (GH-16354)
bpo-38140: Document offsets in PyMemberDef

Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
2019-09-25 13:06:16 +02:00
Emmanuel Arias 17deb16883 bpo-38260: Add Docs on asyncio.run (GH-16337)
Add docs about return and raise exception on asyncio.run





https://bugs.python.org/issue38260



Automerge-Triggered-By: @asvetlov
2019-09-25 01:53:49 -07:00
Victor Stinner 1ce152a42e
bpo-38234: Py_SetPath() uses the program full path (GH-16357)
Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).

Fix also memory leaks in pathconfig_set_from_config().
2019-09-24 17:44:15 +02:00
Lisa Roach ef04851775
bpo-38136: Updates await_count and call_count to be different things (GH-16192) 2019-09-23 20:49:40 -07:00
Victor Stinner fcdb027234
bpo-38236: Dump path config at first import error (GH-16300)
Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.
2019-09-23 14:45:47 +02:00
Kyle Stanley 030fe8e34d Doc: Add whatsnew entry for loop.shutdown_default_executor() (GH-16308) 2019-09-21 08:18:40 +02:00
Ammar Askar 87d6cd3604 bpo-38237: Make pow's arguments have more descriptive names and be keyword passable (GH-16302)
Edit: `math.pow` changes removed on Mark's request.


https://bugs.python.org/issue38237



Automerge-Triggered-By: @rhettinger
2019-09-20 21:28:49 -07:00
Kyle Stanley 77af2290e5 Doc: Remove provisional note for asyncio.run() (GH-16310)
Based on a comment from @asvetlov https://github.com/python/cpython/pull/15735#discussion_r323619076, this removes the provisional note for ``asyncio.run()`` in the documentation.

Automerge-Triggered-By: @1st1
2019-09-20 16:46:21 -07:00
Ram Rachum 9c2682efc6 bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
Mention frame.f_trace in sys.settrace docs, as well as the fact you still
need to call `sys.settrace` to enable the tracing machinery before setting
`frame.f_trace` will have any effect.
2019-09-21 01:19:02 +10:00
Prateek Nayak 062cfe3b11 bpo-37353: Updated parser note about source code compatibility(GH-14277) 2019-09-20 08:55:26 -05:00
Lisa Roach 8b03f943c3
bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947) 2019-09-19 21:04:18 -07:00
Eddie Elizondo 3368f3c6ae bpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)
* Make dict and weakref offsets opaque for C heap types

* Add news
2019-09-19 17:29:05 +01:00
Kyle Stanley 9fdc64cf12 bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() (GH-15735) 2019-09-19 15:47:22 +03:00
toonarmycaptain 3171d67a6a Doc: Clarify dict equality irrespective of ordering. (GH-16266) 2019-09-19 07:51:23 +02:00
Jason Plurad 9ab6038fe8 Doc: Corrected syntax for return annotation (GH-16265)
Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
2019-09-19 07:24:29 +02:00
Victor Stinner 0a963fbc9c
bpo-38203: faulthandler.dump_traceback_later() is always available (GH-16249)
dump_traceback_later() and cancel_dump_traceback_later() functions of
the faulthandler module are always available since Python 3.7.
2019-09-18 14:15:10 +02:00
Diego Alberto Barriga Martínez b57481318e bpo-37904: Edition on python tutorial - section 4 (GH-16169)
A little change on first paragraph of python tutorial to be more clearly



https://bugs.python.org/issue37904



Automerge-Triggered-By: @ericvsmith
2019-09-17 09:57:55 -07:00
Jörn Heissler 219fb9d65e Doc: Fix grammar/spelling in ssl.VERIFY_CRL_CHECK_LEAF docs (GH-16221) 2019-09-17 12:42:30 +02:00
Hrvoje Nikšić 5d359cc62e bpo-38192: Fix remaining passing of "loop" in the protocol examples (GH-16202)
See https://bugs.python.org/issue38192 .



https://bugs.python.org/issue38192
2019-09-17 00:16:43 -07:00
Adorilson Bezerra 63dedef48b Doc: Add list(dict) in stdtypes library (GH-16209) 2019-09-17 06:57:14 +02:00
Ivan Levkivskyi 81528ba2e8
bpo-28556: Update the opening note in typing docs (GH-16204)
This PR replaces the old note mentioning that `typing` is a provisional module with a new one mentioning types are not enforced at runtime. I am not sure if there was any official announcement about making `typing` non-provisional, but _de-facto_ no new features were added during Python 3.7, and no backwards incompatible changes were made except for few small things that were considered bugs.
2019-09-16 23:04:06 +01:00
Adorilson Bezerra f18242be16 Doc: Add link of GNU Readline library to interpreter tutorial (GH-16152) 2019-09-16 18:18:04 +02:00
Adorilson Bezerra b7af4e7565 Doc: remove duplicate word in controlflow tutorial (GH-16163) 2019-09-16 09:04:58 +02:00
Hrvoje Nikšić c717c73fa3 bpo-38178: Don't explicitly pass "loop" to EchoClientProtocol. (GH-16159)
https://bugs.python.org/issue38178
2019-09-15 10:06:02 -07:00
t k 8b31a11a69 bpo38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142) 2019-09-15 07:50:05 +01:00
Kyle Stanley ff603f6c3d bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)
Typically, the second positional argument for ``seek()`` is *whence*. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation for ``io`` module (https://docs.python.org/3/library/io.html#io.IOBase.seek). 

The tutorial for IO is the only location where the second positional argument for ``seek()`` is referred to as *from_what*. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository):

```
$ git grep "from_what"
Doc/tutorial/inputoutput.rst:To change the file object's position, use ``f.seek(offset, from_what)``.  The position is computed
Doc/tutorial/inputoutput.rst:the *from_what* argument.  A *from_what* value of 0 measures from the beginning
Doc/tutorial/inputoutput.rst:the reference point.  *from_what* can be omitted and defaults to 0, using the
```

For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for ``seek()``, particularly since this is the only location where *from_what* is being used.

Note: In the POSIX standard, *whence* is technically the third positional argument, but the first argument *fildes* (file descriptor) is implicit in Python.


https://bugs.python.org/issue37635
2019-09-14 13:29:23 -07:00
Anthony Sottile a26ace19bd Doc: Fix link to window.getch in curses documentation (GH-16132) 2019-09-14 07:17:09 +01:00
Xtreak bdd6945d4d bpo-33095: Add reference to isolated mode in -m and script option (GH-7764)
Attempt to make isolated mode easier to discover via additional inline documentation.

Co-Authored-By: Julien Palard <julien@palard.fr>
2019-09-14 10:35:44 +10:00
Eric O. LEBIGOT (EOL) 77cd0ceab2 Doc: fcntl.lockf() is more powerful than written (GH-6750) 2019-09-13 18:32:28 +01:00
bchhabra2490 d44542f9a2 bpo-32790: Add info about alt format using # for 'g' in chart (GH-6624) 2019-09-13 18:20:21 +01:00
Windson yang 9585f46b97 bpo-26468: Doc: improve the documentation of shutil.copy2 when it can fail. (GH-13765) 2019-09-13 14:36:09 +01:00
Julien Palard 375a3e2bdb
bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095) 2019-09-13 15:07:37 +02:00
Kexuan Sun 53f78ec9e1 Doc: Improve consistency of os.path.normcase with other os.path functions (GH-14004) 2019-09-13 14:01:02 +01:00
Ashwin Ramaswami ff2e182865 bpo-12707: deprecate info(), geturl(), getcode() methods in favor of headers, url, and status properties for HTTPResponse and addinfourl (GH-11447)
Co-Authored-By: epicfaace <aramaswamis@gmail.com>
2019-09-13 12:40:07 +01:00
Xtreak d31b31516c bpo-36889: Document Stream class and add docstrings (GH-14488)
* This just copies the docs from `StreamWriter` and `StreamReader`.
* Add docstring for asyncio functions.


https://bugs.python.org/issue36889



Automerge-Triggered-By: @asvetlov
2019-09-13 03:52:38 -07:00
Rémi Lapeyre 6a517c6749 bpo-8538: Add support for boolean actions to argparse (GH-11478)
Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
2019-09-13 11:17:43 +01:00
Kishore Vancheeshwaran 7183064e9e Doc: Add example snippet for str.isupper() (GH-14681) 2019-09-13 10:20:01 +01:00
Christian Heimes 7cad53e6b0 bpo-9216: Add usedforsecurity to hashlib constructors (GH-16044)
The usedforsecurity keyword only argument added to the hash constructors is useful for FIPS builds and similar restrictive environment with non-technical requirements that legacy algorithms be forbidden by their implementations without being explicitly annotated as not being used for any security related purposes.  Linux distros with FIPS support benefit from this being standard rather than making up their own way(s) to do it.

Contributed and Signed-off-by: Christian Heimes christian@python.org
2019-09-12 19:30:00 -05:00
Patrick McLean 2b2ead7438 bpo-36046: Add user and group parameters to subprocess (GH-11950)
* subprocess: Add user, group and extra_groups paremeters to subprocess.Popen

This adds a `user` parameter to the Popen constructor that will call
setreuid() in the child before calling exec(). This allows processes
running as root to safely drop privileges before running the subprocess
without having to use a preexec_fn.

This also adds a `group` parameter that will call setregid() in
the child process before calling exec().

Finally an `extra_groups` parameter was added that will call
setgroups() to set the supplimental groups.
2019-09-12 18:15:44 +01:00
Matti Picus 57b7dbc46e Emphasize the need to always call PySequence_Fast. (GH-11140) 2019-09-12 17:19:06 +01:00
Hai Shi b1a2abdb06 bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
2019-09-12 16:34:24 +01:00
Raymond Hettinger 4210ad5ebd
bpo-38096: Complete the "structseq" and "named tuple" cleanup (GH-16010) 2019-09-12 07:56:28 -07:00
Julien Palard a45b0efdea Doc: Add -m reference in context of code execution (GH-16045) 2019-09-12 14:19:06 +01:00
Christian Heimes ed4b3216e5 bpo-37363: Document internal audit events (GH-14663)
Three internal cpython events were not documented, yet.

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



https://bugs.python.org/issue37363
2019-09-12 06:13:02 -07:00
Andrew Svetlov a488879cba
bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033) 2019-09-12 15:40:40 +03:00
Brandt Bucher 224b8aaa7e bpo-26868: Fix example usage of PyModule_AddObject. (#15725)
* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
2019-09-12 13:11:20 +01:00
Windson yang 967b84c913 bpo-35325: Doc: imp.find_module() return value documentation discrepancy (GH-11040) 2019-09-12 14:10:50 +02:00
Emmanuel Arias 31a82e25b6 bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456) 2019-09-12 13:29:54 +02:00
Julien Palard 2c910c1e73 bpo-36675: Remove obsolete code. (GH-16024)
Does no longer work since Sphinx moved the trim_doctest_flag option in
the configuration.
2019-09-12 12:23:53 +01:00
Christian Heimes 894d0f7d55 bpo-32008: Prefer client or TLSv1_2 in examples (GH-5797)
Prefer client or TLSv1_2 in examples

Signed-off-by: Christian Heimes <christian@python.org>
2019-09-12 12:10:05 +01:00
Hai Shi f545638b57 bpo-9938: Add optional keyword argument exit_on_error to argparse.ArgumentParser (GH-15362)
Co-Authored-by: Xuanji Li <xuanji@gmail.com>


https://bugs.python.org/issue9938



Automerge-Triggered-By: @matrixise
2019-09-12 03:56:05 -07:00
Harmandeep Singh 2d32bf1ef2 bpo-13927: time.ctime and time.asctime return string explantion (GH-11303)
* bpo-13927: time.ctime and time.asctime return string explantion

* Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date

* Reformat linebreaks
2019-09-12 11:22:30 +01:00
Georgy Frolov 7544497ad3 Doc: Add example of dict() function with positional and keyword arguments (GH-15220) 2019-09-12 10:41:36 +01:00
Joannah Nanjekye 92777d5e5a bpo-18578: Rename and document test.bytecode_helper as test.support.bytecode_helper (GH-15168)
Rename and document test.bytecode_helper as test.support.bytecode_helper
2019-09-12 10:02:59 +01:00
Géry Ogam 891e9e3b44 Correct typos in the codecs module documentation (#15135) 2019-09-12 08:41:32 +01:00
Björn Meier 9936371af2 bpo-36270: Doc: add link to traceback object reference (GH-13119) 2019-09-11 19:55:02 +02:00
Hai Shi 15f5a7527b bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)
https://bugs.python.org/issue37698
2019-09-11 10:25:55 -07:00
Marc e24594bfe7 Doc: recursive glob ** follows symlinks to directories (GH-12918) 2019-09-11 19:17:05 +02:00
Joannah Nanjekye 8d120f75fb bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)
The socket module now has the socket.send_fds() and socket.recv.fds() functions.
Contributed by Joannah Nanjekye, Shinya Okano (original patch)
and Victor Stinner.

Co-Authored-By: Victor Stinner <vstinner@redhat.com>
2019-09-11 19:12:21 +02:00
Hai Shi 5a56ce4a0e bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988)
https://bugs.python.org/issue37750



Automerge-Triggered-By: @matrixise
2019-09-11 09:38:47 -07:00
Julien Palard 1fae844451 Doc: Fix missing negation. (GH-14640)
Reported by Hug Capella on docs@.



Automerge-Triggered-By: @matrixise
2019-09-11 08:55:22 -07:00
toonarmycaptain 0cc27417f2 Improve clarity of try-return-finally-return (GH-15677)
Clarify execution in try-return-finally-return case.
2019-09-11 17:37:13 +02:00
Lysandros Nikolaou af636f4f91 bpo-36182: Update pathlib.Path.write_text() docs (GH-12161)
with the case of an existing file
2019-09-11 17:08:10 +02:00
JunWei Song 3ba51d587f bpo-36260: Add pitfalls to zipfile module documentation (#13378)
* bpo-36260: Add pitfalls to zipfile module documentation

We saw vulnerability warning description (including zip bomb) in Doc/library/xml.rst file.
This gave us the idea of documentation improvement. 

So, we moved a little bit forward :P
And the doc patch can be found (pr).

* fix trailing whitespace

* 📜🤖 Added by blurb_it.

* Reformat text for consistency.
2019-09-11 16:04:11 +01:00
Géry Ogam 3b58a70d9c Improve the io module documentation (GH-15099)
* Update io.rst

* Apply suggestions from code review

Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>

Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
2019-09-11 15:55:13 +01:00
Emily Morehouse 6357c95716 bpo-35224: Additional documentation for Assignment Expressions (GH-15935)
Add or update assignment expression documentation for:
- FAQ - Design
- Reference - Expressions
- Reference - Lexical Analysis


https://bugs.python.org/issue35224



Automerge-Triggered-By: @matrixise
2019-09-11 07:37:12 -07:00
Simon Willison 1abf54336f Doc: Indicate locations of parse_qs, parse_qsl, escape (GH-14828)
Since they have been removed from cgi it's useful to remind people where they
can be found instead.
2019-09-11 16:25:25 +02:00
Andrew Scheller 51adfc6ed2 Update ftplib.all_errors documentation to match code (#15026)
The documentation doesn't mention the `EOFError` that https://github.com/python/cpython/blob/master/Lib/ftplib.py#L66 includes
2019-09-11 16:18:00 +02:00
Raymond Hettinger 7117074410 bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895)
* bpo-38096: Clean up the "struct sequence" / "named tuple" docs

* Fix remaining occurrences of "struct sequence"

* Repair a user visible docstring
2019-09-11 15:17:32 +01:00
Xtreak 7b69069e9a bpo-37651: Document CancelledError is now a subclass of BaseException (GH-15950)
https://bugs.python.org/issue37651



Automerge-Triggered-By: @1st1
2019-09-11 07:12:51 -07:00
Anjali Bansal 97b817eae3 bpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861) 2019-09-11 15:09:53 +01:00
Brennan D Baraban 1660a61a10 bpo-23460: Fix documentation for decimal string :g formatting (GH-11850) 2019-09-11 15:59:37 +02:00
Joannah Nanjekye 1a53c785e6 bpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)
https://bugs.python.org/issue37488



Automerge-Triggered-By: @pganssle
2019-09-11 06:58:42 -07:00
hui shang 088a09af4b bpo-31163: Added return values to pathlib.Path instance's rename and replace methods. (GH-13582)
* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
2019-09-11 14:26:49 +01:00
native-api f9b5840fb4 bpo-33944: note about the intended use of code in .pth files (GH-10131)
https://bugs.python.org/issue33944
2019-09-11 06:21:04 -07:00
Andre Delfino dc26997109 bpo-33459: Fix "tuple displays" term in Expressions.rst (GH-6760)
https://bugs.python.org/issue33459



Automerge-Triggered-By: @matrixise
2019-09-11 06:16:11 -07:00
Géry Ogam 781266ebb6 bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler (GH-11398) 2019-09-11 14:03:46 +01:00
Julien Palard e1d455f3a3 Doc: Use walrus operator in example. (GH-15934) 2019-09-11 15:01:18 +02:00
Ashwin Ramaswami 62cf698142 bpo-35649: update http client example (GH-11441) 2019-09-11 14:41:54 +02:00
Tim Hoffmann 1a13efb7e0 Minor ReST formatting fixes in subprocess docs (#14876) 2019-09-11 13:26:31 +02:00
Xtreak c78dae8d2b bpo-35603: Add a note on difflib table header interpreted as HTML (GH-11439) 2019-09-11 13:21:30 +02:00
Alex 972cf5c06a bpo-35168: Make shlex.punctuation_chars read-only (#11631)
* bpo-35168: Documentation about shlex.punctuation_chars now states that it should be set in __init__.py

* bpo-35168: Convert shlex.punctuation_chars to read-only property

* Add NEWS.d entry
2019-09-11 12:04:04 +01:00
Xtreak 6a9fd66f6e bpo-32972: Document IsolatedAsyncioTestCase of unittest module (GH-15878)
* Document `unittest.IsolatedAsyncioTestCase` API
* Add a simple example with respect to order of evaluation of setup and teardown calls.


https://bugs.python.org/issue32972



Automerge-Triggered-By: @asvetlov
2019-09-11 04:02:14 -07:00
Ezio Melotti 2d8d597bb8 bpo-38103: fix conflicting labels in the docs. (GH-15906) 2019-09-11 11:57:59 +01:00
smokephil 7a0023e8d1 bpo-25810: Clarify eval() docs, it does not keywords (GH-15173) 2019-09-11 05:30:04 -05:00
Kyle Stanley 6472ece5a0 bpo-37585: Add clarification regarding comparing dict.values() (GH-14954) 2019-09-11 11:01:41 +01:00
Anjali 4576b5431b bpo-16438: Doc: confusing text regarding numeric precedence corrected (GH-10521) 2019-09-11 11:58:27 +02:00
Brad 3fb1363fe8 Overhaul datetime documentation (GH-13410)
This is a restructuring of the datetime documentation to hopefully make
them more user-friendly and approachable to new users without losing any
of the detail.

Changes include:
 - Creating dedicated subsections for some concepts such as:
    - "Constants"
    - "Naive vs Aware"
    - "Determining if an Object is Aware"
 - Give 'naive vs aware' its own subsection
 - Give 'constants' their own subsection
 - Overhauling the strftime-strptime section by:
    - Breaking it into logical, linkable, and digestable parts
    - Adding a high-level comparison table
    - Moving the technical detail to bottom: readers come to this
      section primarily to remind themselves to things:
      - How do I write the format code for X?
      - strptime/strftime: which one is which again?
 - Touching up fromisoformat + isoformat sections by:
    - Revising fromisoformat + isoformat for date, time, and
      datetime
    - Adding basic examples
    - Enforcing consistency about putting formats (i.e. ``HH:MM``)
      in double backticks.  This was previously done in some places
      but not all
    - Putting long 'supported formats', on their own line to improve
      readability
 - Moving the 'seealso' section to the top and add a link to dateutil
    Rationale: This doesn't really belong nested under the
    'constants' section.  Let readers know right away that
    datetime is one of several related tools.
 - Moving common features of several types into one place:
    Previously, each type went out of its way to note separately
    that it was hashable and picklable.  These can be brought
    into one single place that is more prominent.
 - Reducing some verbose explanations to improve readability
 - Breaking up long paragraphs into digestable chunks
 - Displaying longer "equivalent to" examples, as short code blocks
 - Using the dot notation for datetime/time classes:
    Use :class:`.time` and :class:`.datetime` rather than :class:`time` and
    :class:`datetime`; otherwise, the generated links will route to the
    respective modules, not classes.
 - Rewording the tzinfo class description
    The top paragraph should get straight to the point of telling the reader
    what subclasses of tzinfo _do_.  Previously, that was hidden in a later
    paragraph.
 - Adding a note on .today() versus .now()
 - Rearranging and expanding example blocks, including:
    - Moved long, multiline inline examples to standalone examples
    - Simplified the example block for timedelta arithmetic:
        - Broke the example into two logical sections:
          1. normalization/parameter 'merging'
          2. timedelta arithmetic
        - Reduced the complexity of the some of the examples.  Show
          reasonable, real-world uses cases that are easy to follow
          along with and progres in difficult slightly.
    - Broke up the example sections for date and datetime sections by putting
      the easy examples first, progressing to more esoteric situations and
      breaking it up into logical sections based on what the methods are
      doing at a high level.
    - Simplified the KabulTz example:
        - Put the class definition itself into a non-REPL block since there is
          no interactive output involved there
        - Briefly explained what's happening before launching into the code
        - Broke the example section into visually separate chunks
 - Various whitespace, formatting, style and grammar fixes including:
    - Consistently using backctics for 'date_string' formats
    - Consistently using one space after periods.
    - Consistently using bold for vocab terms
    - Consistently using italics when referring to params:
      See https://devguide.python.org/documenting/#id4
    - Using '::' to lead into code blocks
        Per https://devguide.python.org/documenting/#source-code, this will
        let the reader use the 'expand/collapse' top-right button for REPL
        blocks to hide or show the prompt.
    - Using consistent captialization schemes
    - Removing use of the default role
    - Put 'example' blocks in Markdown subsections

This is a combination of 66 commits.

See bpo-36960: https://bugs.python.org/issue36960
2019-09-11 10:19:05 +01:00
wwuck efd5741ae9 bpo-38034: Fix typo in logging.handlers.rst (GH-15708) 2019-09-11 07:44:37 +01:00
jdkandersson 9cbb97b29e bpo-37574: Mention helper functions for find_spec documentation (GH-14739) 2019-09-10 17:06:22 +01:00
Andre Delfino 912108891d bpo-33602: Doc: Remove set and queue references from Data Types (GH-7055) 2019-09-10 17:11:16 +02:00
Kyle Stanley b6dafe5139 Docs: Small tweaks to c-api/intro#Include_Files (GH-14698) 2019-09-10 16:09:34 +01:00
William Andrea faff81c05f Correct info about "f.read(size)". (GH13852)
In text mode, the "size" parameter indicates the number of characters, not bytes.
2019-09-10 15:50:26 +01:00
Andre Delfino 05184515f9 Correct minor grammatical mistake in open docs (GH-15865) 2019-09-10 15:48:05 +01:00
Dmitry Shachnev c3d679fd39 bpo-37504: Fix documentation build with texinfo builder (GH-14606)
In the table model used by docutils, the `cols` attribute of `tgroup`
nodes is mandatory, see [1]. It is used in texinfo builder in [2].

[1]: https://www.oasis-open.org/specs/tm9901.htm#AEN348
[2]: https://github.com/sphinx-doc/sphinx/blob/v2.1.2/sphinx/writers/texinfo.py#L1129

* Doc: Add texinfo support to the Makefile
2019-09-10 15:40:50 +01:00
Steve Dower a39a4c7439
bpo-37913: Link to NotImplemented from new docs (GH-15860) 2019-09-10 15:25:12 +01:00
Jeroen Demeyer 009ef2955d bpo-37913: document that __length_hint__ can return NotImplemented (GH-15383) 2019-09-10 15:01:13 +01:00
Jason R. Coombs 17499d8270 bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)
https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
2019-09-10 14:53:31 +01:00
Zach Thompson c2f056be82 Fix typo in ssl.RAND_bytes documentation (GH-14791)
It looks like "cryptographically strong" is the preferred phrase from the surrounding documentation.

Automerge-Triggered-By: @tiran
2019-09-10 06:40:14 -07:00
Andre Delfino c1d8c1cb8e Note regarding + mode truncation applies to both text and binary mode (#11314)
* Improve doc on open's mode +

* Improve wording

* Address comment from Rémi
2019-09-10 14:04:22 +01:00
Arun Persaud 9a94093189 bpo-21018: added missing documentation about escaping characters for configparser (GH-6137)
Document how $ and % can be escaped in configparser.
2019-09-10 14:51:09 +02:00
Emmanuel Arias 9008be303a bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

fourth step: queue.py





https://bugs.python.org/issue36373
2019-09-10 04:46:12 -07:00
Emmanuel Arias 537877d85d bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [locks] (GH-13920)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Third step: locks.py





https://bugs.python.org/issue36373
2019-09-10 03:55:07 -07:00
Jeroen Demeyer 9669931e5e bpo-36971: add subsections in C API "Common Object Structures" page (#13446) 2019-09-10 11:41:59 +01:00
Xtreak c8dfa7333d bpo-37052: Add examples for mocking async iterators and context managers (GH-14660)
Add examples for mocking asynchronous iterators and asynchronous context managers.


https://bugs.python.org/issue37052
2019-09-10 03:37:17 -07:00
Nikhil 80428ed4e1 bpo-25237: Documentation for tkinter modules (GH-1870) 2019-09-10 10:55:34 +02:00
Jean-François B b5381f6697 bpo-34293: Fix PDF documentation paper size (GH-8585)
The "A4" pdfs were previously the wrong size due to a change in the options in Sphinx 1.5.

See also sphinx-doc/sphinx#5235
2019-09-09 22:52:03 +01:00
Serhiy Storchaka 832e864008
bpo-38049: Add command-line interface for the ast module. (GH-15724) 2019-09-09 23:36:13 +03:00
Lisa Roach b9f65f01fd
bpo-37383: Updates docs to reflect AsyncMock call_count after await. (#15761)
* bpo-351428: Updates documentation to reflect AsyncMock call_count after await.

* Adds skip and fixes warning.

* Removes extra >>>.

* Adds ... in front of await mock().
2019-09-09 17:54:13 +01:00
Greg Price 64c6ac74e2 bpo-36502: Update link to UAX #44, the Unicode doc on the UCD. (GH-15301)
The link we have points to the version from Unicode 6.0.0, dated 2010.
There have been numerous updates to it since then:
  https://www.unicode.org/reports/tr44/#Modifications

Change the link to one that points to the current version. Also, use HTTPS.
2019-09-09 09:37:13 -07:00
Serhiy Storchaka 850573b836
bpo-37995: Add an option to ast.dump() to produce a multiline output. (GH-15631) 2019-09-09 19:33:13 +03:00
Anthony Sottile 370138ba9c bpo-35803: Document and test dir=PathLike for tempfile (GH-11644)
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
2019-09-09 10:54:34 -05:00
Boris Verhovsky 9488a5289d Clarify that shutil's copy functions can accept path-like values (GH-15141) 2019-09-09 08:51:56 -07:00
Richard Sanger bb668f798a Fix docs bz.open default mode (GH-15100)
bz2.open()'s default mode is rb, not r
2019-09-09 08:49:47 -07:00
Antoine 88b24f96ae Minor changes in Doc/faq/library. (#15449)
* Minor changes.

* Update Doc/faq/library.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Apply suggestions from aeros167.

* Update Doc/faq/library.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Apply suggestions from aeros167 + re-add a "a" that was accidentally deleted.
2019-09-09 17:00:43 +02:00
Mario Corchero f5e7f39d29 docs: Add references to AsyncMock in unittest.mock.patch (#13681)
Update the docs as patch can now return an AsyncMock if the patched
object is an async function.
2019-09-09 15:18:06 +01:00
Jon Janzen 24b11b8c95 bpo-38053 Update documentation for plistlib (GH-15727)
* Update documentation for plistlib

-  Update "Mac OS X" to "Apple" since plists are used more widely than just macOS
-  Re-add the UID class documentation (oops, removed in GH-15615)
2019-09-09 16:13:43 +02:00
Vinay Sajip 264e034f99
bpo-37662: Documented venv.EnvBuilder.upgrade_dependencies(). (GH-15768) 2019-09-09 14:50:38 +01:00
Ashwin Vishnu 1a8de82d3a Fix typo in math.prod example (GH-15614) 2019-09-09 13:42:27 +01:00
David Röthlisberger 4f0f9f066e logging.Formatter docs: Add missing `validate` parameter, clarify `style` parameter (GH-15222) 2019-09-09 12:29:54 +01:00
Julien Palard 63c98ed2d2
Doc: Fix PDF build (NoUri). (GH-15739) 2019-09-09 12:54:56 +02:00
Serhiy Storchaka 526a01467b
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
2019-09-09 11:47:14 +03:00
Serhiy Storchaka 918b468b7d
Revert "Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)" (GH-15736)
This reverts commit fa220ec763.
2019-09-09 11:18:16 +03:00
Raymond Hettinger 4db25d5c39
bpo-36018: Address more reviewer feedback (GH-15733) 2019-09-08 16:57:58 -07:00
Greg Price 32a960f8e1 Correct Roman-numeral example in Unicode HOWTO. (GH-15541) 2019-09-08 12:42:13 +03:00
Joannah Nanjekye 3ccdbc3338 bpo-20806: Reference both times(2) and times(3) and link to MSDN. (GH-15479) 2019-09-07 10:05:29 +03:00
Joannah Nanjekye 74b662cf20 bpo-15088 : Remove PyGen_NeedsFinalizing() (GH-15702)
Remove PyGen_NeedsFinalizing(): it was not
documented, tested or used anywhere within CPython after
the implementation of PEP 442.
2019-09-06 17:41:38 +02:00
Raymond Hettinger d8c93aa5d2
More refinements to the statistics docs (GH-15713) 2019-09-05 23:02:27 -07:00
Joannah Nanjekye 2bc43cdc01 bpo-37878: Remove PyThreadState_DeleteCurrent() function (GH-15315)
* Rename PyThreadState_DeleteCurrent()
  to _PyThreadState_DeleteCurrent()
* Move it to the internal C API

Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
2019-09-05 18:06:49 +02:00
Miro Hrončok 2c2b561967 bpo-36797: Fix a dead link in Doc/distutils/apiref (GH-15700)
https://bugs.python.org/issue36797
2019-09-05 08:06:45 -07:00
Andre Delfino 3038e87ba8 Correct minor gramatical mistake in sys.settrace doc (GH-15637) 2019-09-05 13:10:37 +02:00
Jon Janzen ce81a925ef bpo-36409: Remove old plistlib API deprecated in 3.4 (GH-15615)
* Remove implementation for old plistlib API deprecated in 3.4
2019-09-05 10:11:35 +02:00
Raymond Hettinger 9b51570ffd
bpo-36324: Apply review comment from Jake Vanderplas (GH-15695) 2019-09-05 01:03:14 -07:00
Raymond Hettinger e4810b2a6c
bpo-36324: Apply review comments from Allen Downey (GH-15693) 2019-09-05 00:18:47 -07:00
Roger Iyengar 675d17cec4 Fix grammar in asyncio-dev.rst (GH-15672)
Automerge-Triggered-By: @ned-deily
2019-09-03 23:04:09 -07:00
Greg Price 2f09413947 closes bpo-37966: Fully implement the UAX #15 quick-check algorithm. (GH-15558)
The purpose of the `unicodedata.is_normalized` function is to answer
the question `str == unicodedata.normalized(form, str)` more
efficiently than writing just that, by using the "quick check"
optimization described in the Unicode standard in UAX #15.

However, it turns out the code doesn't implement the full algorithm
from the standard, and as a result we often miss the optimization and
end up having to compute the whole normalized string after all.

Implement the standard's algorithm.  This greatly speeds up
`unicodedata.is_normalized` in many cases where our partial variant
of quick-check had been returning MAYBE and the standard algorithm
returns NO.

At a quick test on my desktop, the existing code takes about 4.4 ms/MB
(so 4.4 ns per byte) when the partial quick-check returns MAYBE and it
has to do the slow normalize-and-compare:

  $ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
      -- 'unicodedata.is_normalized("NFD", s)'
  50 loops, best of 5: 4.39 msec per loop

With this patch, it gets the answer instantly (58 ns) on the same 1 MB
string:

  $ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
      -- 'unicodedata.is_normalized("NFD", s)'
  5000000 loops, best of 5: 58.2 nsec per loop

This restores a small optimization that the original version of this
code had for the `unicodedata.normalize` use case.

With this, that case is actually faster than in master!

$ build.base/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
    -- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 561 usec per loop

$ build.dev/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
    -- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 512 usec per loop
2019-09-03 19:45:44 -07:00
Anthony Sottile e1786b5416 bpo-36853: Fix suspicious.py to actually print the unused rules (#13579)
* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
2019-09-02 12:01:23 -04:00
Jason R. Coombs 102e9b40ff
bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)
Sync importlib.metadata with importlib_metadata 0.20.
2019-09-02 11:08:03 -04:00
Serhiy Storchaka 5eca7f3f38
bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621) 2019-09-01 12:12:52 +03:00
Serhiy Storchaka f02ea6225b
bpo-36543: Remove old-deprecated ElementTree features. (GH-12707)
Remove methods Element.getchildren(), Element.getiterator() and
ElementTree.getiterator() and the xml.etree.cElementTree module.
2019-09-01 11:18:35 +03:00
Daniel Pope daa82d019c bpo-37977: Warn more strongly and clearly about pickle security (GH-15595) 2019-08-30 22:51:33 -07:00
Min ho Kim 39d87b5471 Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
Paul Ganssle 59725f3bad bpo-37979: Add alternative to fromisoformat in documentation (GH-15596)
Adds a link to `dateutil.parser.isoparse` in the documentation.

It would be nice to set up intersphinx for things like this, but I think we can leave that for a separate PR.

CC: @pitrou 

[bpo-37979](https://bugs.python.org/issue37979)


https://bugs.python.org/issue37979



Automerge-Triggered-By: @pitrou
2019-08-29 07:47:48 -07:00
Raymond Hettinger 35f6301d68
bpo-10978: Semaphores can release multiple threads at a time (GH-15588) 2019-08-29 01:45:19 -07:00
Raymond Hettinger 0dac68f1e5
bpo-36743: __get__ is sometimes called without the owner argument (#12992) 2019-08-29 01:27:42 -07:00
Raymond Hettinger 84125fed2a
bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566) 2019-08-29 00:58:08 -07:00
Raymond Hettinger cd81f0500f
bpo-23674: Clarify ambiguities in super() docs (#15564) 2019-08-29 00:44:02 -07:00
Serhiy Storchaka e64f948e76
bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510) 2019-08-29 09:30:23 +03:00
Rémi Lapeyre f5896a05ed bpo-35946: Improve assert_called_with documentation (GH-11796) 2019-08-29 02:15:53 -04:00
Raymond Hettinger 03acba6f1a
bpo-25777: Wording describes a lookup, not a call (GH-15573) 2019-08-28 22:59:43 -07:00
avinassh 3aa48b88c7 bpo-36167: fix an incorrect capitalization (GH-14482) 2019-08-29 01:40:50 -04:00
HongWeipeng fa220ec763 Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567) 2019-08-28 20:39:25 -07:00
Vinay Sharma 13f37f2ba8 closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)
https://bugs.python.org/issue37964



Automerge-Triggered-By: @benjaminp
2019-08-28 18:56:17 -07:00
Christian Heimes 98d90f745d
bpo-37951: Lift subprocess's fork() restriction (GH-15544) 2019-08-27 23:36:56 +02:00
Ethan Furman 77df9a1573
correct roman numeral VII description (GH-15523) 2019-08-26 09:12:50 -07:00
Sergey Fedoseev b3b9619f5e Fix typo: Pyssize_t => Py_ssize_t (GH-15411) 2019-08-26 16:20:42 +01:00
Serhiy Storchaka c3ea41e9bf
bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). (GH-15490)
It emits a deprecation warning and calls corresponding method
visit_Num(), visit_Str(), etc.
2019-08-26 10:13:19 +03:00
Joannah Nanjekye 6b16d938d6 bpo-15542: Documentation incorrectly suggests __init__ called after direct __new__ call (GH-15478) 2019-08-25 23:53:11 -07:00
Julien Palard 73e0549701 Doc: Keep the venv/* exclude pattern. (GH-15229)
In case it has been previously created.
2019-08-26 02:11:43 -04:00
Nick Coghlan 5dbe0f59b7
bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)
- drop TargetScopeError in favour of raising SyntaxError directly
  as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
  named expression targets in comprehensions are nonlocal or
  global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
  comprehension have an ambiguous target scope. Avoid resolving
  that question now by raising SyntaxError. PEP 572
  originally required this only for cases where the bound name
  conflicts with the iteration variable in the comprehension,
  but CPython can't easily restrict the exception to that case
  (as it doesn't know the target variable names when visiting
  the outermost iterator expression)
2019-08-25 23:45:40 +10:00
Zackery Spytz ce6a070414 bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)
Fix assert statement misbehavior if AssertionError is shadowed.
2019-08-25 12:44:09 +03:00
Raymond Hettinger 8371799e30
bpo-37905: Improve docs for NormalDist (GH-15486) 2019-08-25 00:57:26 -07:00
Berker Peksag 805f8f9afe bpo-19072: Make @classmethod support chained decorators (GH-8405) 2019-08-24 15:37:25 -07:00
Jürgen Gmach c5218fce02 Clarify argument types in datetime docs. (GH-15459)
"Arguments may be integers... " could be misunderstand as they also
could be strings.

New wording makes it clear that arguments have to be integers.

modified:   Doc/library/datetime.rst



Automerge-Triggered-By: @pganssle
2019-08-24 12:48:55 -07:00
Raymond Hettinger 69ee87e99c
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) 2019-08-24 11:15:44 -07:00
Raymond Hettinger edd21129dd
bpo-32118: Simplify docs for sequence comparison (GH-15450) 2019-08-24 10:43:55 -07:00
Serhiy Storchaka e9c90aa431
bpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269) 2019-08-24 12:49:27 +03:00
Ned Deily 7913cbc09d
Fix link to changelog in 3.9 What's New page (GH-15445) 2019-08-24 01:12:05 -04:00
Antoine e17f201cd9 Fix funny typo in Doc/bugs. (GH-15412)
Fix typo in description of link to mozilla bug report writing guidelines.

Though the URL is misleading, we're indeed trying to write bug _reports_, not to add bugs.

Automerge-Triggered-By: @ned-deily
2019-08-23 21:09:43 -07:00
Raymond Hettinger 8f080b0995
bpo-26589: Add http status code 451 (GH-15413) 2019-08-23 10:19:15 -07:00
Victor Stinner 1beb7c3de9
bpo-36763, doc: Add links in the new C API init doc (GH-15433) 2019-08-23 17:59:12 +01:00
Victor Stinner 3842f2997f
bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423) 2019-08-23 16:57:54 +01:00
Stefan Behnel b5d3ceea48
bpo-14465: Add an indent() function to xml.etree.ElementTree to pretty-print XML trees (GH-15200) 2019-08-23 16:44:25 +02:00
Andre Delfino d288b29fc6 Correct minor grammar mistake (GH-15404) 2019-08-23 10:58:27 +01:00
Raymond Hettinger 6fcb6cfb13
bpo-30826: Improve control flow examples (GH-15407) 2019-08-22 23:44:19 -07:00
Raymond Hettinger 483ae0cf1d
bpo-12634: Clarify an awkward section of the tutorial (GH-15406) 2019-08-22 23:27:04 -07:00
Raymond Hettinger 657008ea03
bpo-30550: Clarify JSON ordering guarantees (GH-15397) 2019-08-22 15:14:42 -07:00
Raymond Hettinger d0cdeaab76
bpo-32554: Deprecate hashing arbitrary types in random.seed() (GH-15382) 2019-08-22 09:19:36 -07:00
Raymond Hettinger 4109263a7e
bpo-14050: Note that not all data can be sorted (GH-15381) 2019-08-22 09:11:35 -07:00
Sergey Fedoseev a38e9d1399 bpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388) 2019-08-22 16:28:28 +01:00
Brett Cannon 48ede6b8f6
bpo-37663: have venv activation scripts all consistently use __VENV_PROMPT__ for prompt customization (GH-14941)
The activation scripts generated by venv were inconsistent in how they changed the shell's prompt. Some used `__VENV_PROMPT__` exclusively, some used `__VENV_PROMPT__` if it was set even though by default `__VENV_PROMPT__` is always set and the fallback matched the default, and one ignored `__VENV_PROMPT__` and used `__VENV_NAME__` instead (and even used a differing format to the default prompt). This change now has all activation scripts use `__VENV_PROMPT__` only and relies on the fact that venv sets that value by default.

The color of the customization is also now set in fish to the blue from the Python logo for as hex color support is built into that shell (much like PowerShell where the built-in green color is used).
2019-08-21 15:58:01 -07:00
Steve Dower df2d4a6f3d
bpo-37834: Normalise handling of reparse points on Windows (GH-15231)
bpo-37834: Normalise handling of reparse points on Windows
* ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed)
* nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point)
* nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour)
* nt.readlink() will read destinations for symlinks and junction points only

bpo-1311: os.path.exists('nul') now returns True on Windows
* nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
2019-08-21 15:27:33 -07:00
Steve Dower 75e064962e
bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287) 2019-08-21 13:43:06 -07:00
Roger Iyengar 092911d5c0 Update asyncio.ensure_future() documentation (GH-15347)
Added back mention that ensure_future actually scheduled obj. This documentation just mentions what ensure_future returns, so I did not realize that ensure_future also schedules obj.
2019-08-21 11:59:11 -04:00
Ashwin Ramaswami 87bc3b7a0b bpo-37860: Add netlify deploy preview for docs (GH-15288)
* add netlify deploy preview

* fix publish path

* install python3 venv

* add sudo

* try without venv

* install right dependencies

* use python3, not python

* use pip3

* python3.7

* use requirements.txt

* move requirements.txt to Doc

* use python 3.7 in runtime.txt

* move runtime.txt

* Update requirements.txt
2019-08-21 22:08:47 +09:00
Michael Anckaert e0b6117e27 bpo-37823: Fix open() link in telnetlib doc (GH-15281)
Fixed wrong link to Telnet.open() method in telnetlib documentation.
2019-08-21 12:13:34 +01:00
Greg Price 9ece4a5057 Unmark files as executable that can't actually be executed. (GH-15353)
There are plenty of legitimate scripts in the tree that begin with a
`#!`, but also a few that seem to be marked executable by mistake.

Found them with this command -- it gets executable files known to Git,
filters to the ones that don't start with a `#!`, and then unmarks
them as executable:

    $ git ls-files --stage \
      | perl -lane 'print $F[3] if (!/^100644/)' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          || chmod a-x "$f"; \
        done

Looking at the list by hand confirms that we didn't sweep up any
files that should have the executable bit after all.  In particular

 * The `.psd` files are images from Photoshop.

 * The `.bat` files sure look like things that can be run.
   But we have lots of other `.bat` files, and they don't have
   this bit set, so it must not be needed for them.



Automerge-Triggered-By: @benjaminp
2019-08-20 21:53:59 -07:00
Joannah Nanjekye 9e66aba999 bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
Implement PyBuffer_SizeFromFormat() function (previously
documented but not implemented): call struct.calcsize().
2019-08-20 15:46:36 +01:00
Antoine d3c8d73514 Minor documentation fixes on library/enum (GH-15234)
* Minor documentation fixes on library/enum
2019-08-19 18:41:31 -07:00
Steve Dower cf9360e524
Remove 'unstable' warning for Windows Store package in docs (GH-15334) 2019-08-19 10:07:25 -07:00
cocoatomo 455856391c Insert a missing close parenthesis (GH-15316) 2019-08-18 05:40:23 +09:00
Éric Araujo 1b1d0514ad fix link to time function from time_ns doc (GH-15285)
Because mod, func, class, etc all share one namespace, :func:time creates a link to the time module doc page rather than the time.time function.
2019-08-17 13:34:08 -07:00
Jeroen Demeyer 0567786d26 bpo-37540: vectorcall: keyword names must be strings (GH-14682)
The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not.

CC @markshannon @vstinner 


https://bugs.python.org/issue37540
2019-08-16 03:41:27 -07:00
Hai Shi 68e495df90 bpo-37775: Update compileall doc for invalidation_mode parameter (GH-15148) 2019-08-15 00:03:11 +02:00
Abhilash Raj dcfe111eb5 bpo-37826: Document exception chaining in Python tutorial for errors. (GH-15243)
https://bugs.python.org/issue37826
2019-08-14 14:11:32 -07:00
Greg Price 6bccbe7dfb bpo-36502: Correct documentation of str.isspace() (GH-15019)
The documented definition was much broader than the real one:
there are tons of characters with general category "Other",
and we don't (and shouldn't) treat most of them as whitespace.

Rewrite the definition to agree with the comment on
_PyUnicode_IsWhitespace, and with the logic in makeunicodedata.py,
which is what generates that function and so ultimately governs.

Add suitable breadcrumbs so that a reader who wants to pin down
exactly what this definition means (what's a "bidirectional class"
of "B"?) can do so.  The `unicodedata` module documentation is an
appropriate central place for our references to Unicode's own copious
documentation, so point there.

Also add to the isspace() test a thorough check that the
implementation agrees with the intended definition.
2019-08-14 13:05:19 +02:00
Ngalim Siregar 38c7199beb bpo-37256: Wording in Request class docs (#14792)
* bpo-37256: Wording in Request class docs

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
2019-08-13 18:10:58 -07:00
Hai Shi 82642a052d bpo-37689: add Path.is_relative_to() method (GH-14982) 2019-08-13 21:54:02 +02:00
Josh Holland 8a784af750 bpo-37814: Document the empty tuple type annotation syntax (GH-15208)
https://bugs.python.org/issue37814:

> The empty tuple syntax in type annotations, `Tuple[()]`, is not obvious from the examples given in the documentation (I naively expected `Tuple[]` to work); it has been documented in PEP 484 and in mypy, but not in the documentation for the typing module.


https://bugs.python.org/issue37814
2019-08-13 12:05:09 -07:00
Raymond Hettinger 66a34d35e4
bpo-37759: Second round of edits to Whatsnew 3.8 (GH-15204) 2019-08-12 15:55:18 -07:00
Dong-hee Na 44046fe4fc bpo-37804: Remove the deprecated method threading.Thread.isAlive() (GH-15225) 2019-08-12 19:41:08 +02:00
Ismail S f9590edfea Fix docs for assert_called and assert_called_once (#15197) 2019-08-12 01:57:03 -05:00
Raymond Hettinger f03b4c8a48
bpo-37819: Add Fraction.as_integer_ratio() (GH-15212) 2019-08-11 14:40:59 -07:00
Gregory P. Smith b4be87a04a bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)
DeprecationWarning will continue to be emitted for invalid escape
sequences in string and bytes literals just as it did in 3.7.

SyntaxWarning may be emitted in the future. But per mailing list
discussion, we don't yet know when because we haven't settled on how to
do so in a non-disruptive manner.

(Applies 4c5b6bac24 to the master branch).
(This is https://github.com/python/cpython/pull/15142 for master/3.9)


https://bugs.python.org/issue32912



Automerge-Triggered-By: @gpshead
2019-08-10 00:19:07 -07:00
Raymond Hettinger e43e7ed364
bpo-35892: Add usage note to mode() (GH-15122) 2019-08-08 01:23:05 -07:00
Géry Ogam 362f5350eb Update pickle.rst (GH-14128)
* Edits for readability and grammar
2019-08-06 22:02:23 -07:00
sweeneyde e9cbcd0018 bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482)
https://bugs.python.org/issue37004
2019-08-06 21:37:08 -07:00
Raymond Hettinger 610a4823cc
bpo-37646: Document that eval() cannot access nested scopes (GH-15117) 2019-08-06 17:56:22 -07:00
Géry Ogam cfebfef2de Improve signal documentation (GH-14274)
* add a missing ``.. availability::`` reST explicit markup;
* more consistent "see man page" sentences.
2019-08-06 14:12:22 -07:00
Raymond Hettinger 4f9ffc9d1a
bpo-37759: First round of major edits to Whatsnew 3.8 (GH-15127) 2019-08-05 13:33:19 -07:00
Terry Jan Reedy 14070299cd
bpo-37748: Re-order the Run menu. (GH-15115)
Put the most common choice, Run Module, at the top.
2019-08-04 16:45:15 -04:00
Raymond Hettinger adf02b36b3
Update itertools docs (GH-15114)
* Remove suggestion that is less relevant now that global lookups are much faster
* Add link for installing the recipes
2019-08-04 13:35:58 -07:00
Serhiy Storchaka 18b711c5a7
bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)
The collection's item is now always at the left and
the needle is on the right of ==.
2019-08-04 14:12:48 +03:00
Serhiy Storchaka 17e52649c0
bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
2019-08-04 12:38:46 +03:00
Ngalim Siregar c5fa44944e bpo-37444: Update differing exception between builtins and importlib (GH-14869)
Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure.


https://bugs.python.org/issue37444



Automerge-Triggered-By: @brettcannon
2019-08-02 22:46:02 -07:00
Joannah Nanjekye 854d0a4b98 bpo-36487: Make C-API docs clear about what the main interpreter is. (gh-12666) 2019-08-02 09:50:22 -06:00
mental 2491134029 bpo-37726: Prefer argparse over getopt in stdlib tutorial (#15052) 2019-08-01 07:17:30 -07:00
David H ed5e8e06cb bpo-37730: Fix usage of NotImplemented instead of NotImplementedError in docs. (GH-15062) 2019-08-01 01:49:55 +03:00
Hai Shi 1b29af83bc bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994) 2019-07-31 16:48:15 +02:00
karl ding 31c4fd2a10 bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)
Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct
flags (provided by <linux/can/bcm.h>) under the socket library.

This adds the following constants with a CAN_BCM prefix:

  * SETTIMER
  * STARTTIMER
  * TX_COUNTEVT
  * TX_ANNOUNCE
  * TX_CP_CAN_ID
  * RX_FILTER_ID
  * RX_CHECK_DLC
  * RX_NO_AUTOTIMER
  * RX_ANNOUNCE_RESUME
  * TX_RESET_MULTI_IDX
  * RX_RTR_FRAME
  * CAN_FD_FRAME

The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other
ones were present since SocketCAN drivers were mainlined in 2.6.25. As
such, it is probably unnecessary to guard against these constants being
missing.
2019-07-31 10:47:16 +02:00
Vinay Sajip 472eced677
Refined Qt GUI example in the logging cookbook. (GH-15045) 2019-07-31 07:36:45 +01:00
Terry Jan Reedy 5982b7201b
bpo-33821: Update IDLE section of What's New 3.7 (#15036)
* bpo-33821: Update IDLE section of What's New 3.7

* Fix roles.
2019-07-31 01:04:29 -04:00
Terry Jan Reedy a72ca90eb9
bpo-33822: Add IDLE section of What's New 3.8 (#15035)
* bpo-33822: Add IDLE section of What's New 3.8

* Fix role.
2019-07-31 01:03:53 -04:00
Min ho Kim c4cacc8c5e Fix typos in comments, docs and test names (#15018)
* Fix typos in comments, docs and test names

* Update test_pyparse.py

account for change in string length

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: splitable -> splittable

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Apply suggestion: Dealloccte -> Deallocate

Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu>

* Update posixmodule checksum.

* Reverse idlelib changes.
2019-07-30 18:16:13 -04:00
Jake Tesler 84846b0187 bpo-36084: Add threading Native ID information to What's New documentation (GH-14845) 2019-07-30 23:41:46 +02:00
Pablo Galindo 9211e2fd81 bpo-37268: Add deprecation notice and a DeprecationWarning for the parser module (GH-15017)
Deprecate the parser module and add a deprecation warning triggered on import and a warning block in the documentation.





https://bugs.python.org/issue37268



Automerge-Triggered-By: @pablogsal
2019-07-30 04:04:01 -07:00
Nick Coghlan 17a058ed6f
Remove trailing .0 from version changed note (GH-14987) 2019-07-28 21:40:47 +10:00
Raymond Hettinger 6b5f1b496f
bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975) 2019-07-27 14:04:29 -07:00
Vinay Sajip 1ed915e8ae
Add Qt GUI example to the logging cookbook. (GH-14978) 2019-07-27 13:46:53 +01:00
Derek Keeler 91e4957509 bpo-32910: Remove implementation detail in venv documentation. (GH-14968) 2019-07-26 14:57:11 -07:00
Steve Dower 9d9893a1c8
bpo-35524: Update Windows installer image in docs (GH-14966) 2019-07-26 13:03:58 -07:00
Tzu-ping Chung 544fa15ea1 Swap 'if' branches so content matches to condition in importlib example (GH-14947)
Prior to this change the guard on an 'elif' used an assignment expression whose value was used in a later 'else' block, causing some confusion for people.

(Discussion on Twitter: https://twitter.com/brettsky/status/1153861041068994566.)

Automerge-Triggered-By: @brettcannon
2019-07-25 10:20:33 -07:00
Stefan Behnel a3697db010
bpo-34160: explain how to deal with attribute order in ElementTree (GH-14867)
* Fix the formatting in the documentation of the tostring() functions.

* bpo-34160: Document that the tostring() and tostringlist() functions also preserve the attribute order now.

* bpo-34160: Add an explanation of how users should deal with the attribute order.
2019-07-24 20:22:50 +02:00
Brett Cannon 2f224a077a
Touch up venv docs (GH-14922) 2019-07-23 14:34:32 -07:00
Tal Einat 7123ea009b
bpo-17535: IDLE editor line numbers (GH-14030) 2019-07-23 15:22:11 +03:00
Vinay Sajip d309352c6f
Update logging cookbook to show multiple worker processes using the concurrent.futures module. (#14905) 2019-07-22 12:14:50 +01:00
Raymond Hettinger b530a4460b
Add examples to elucidate the formulas (GH-14898) 2019-07-21 16:32:00 -07:00
Min ho Kim 96e12d5f4f Fix typos in docs, comments and test assert messages (#14872) 2019-07-21 16:12:33 -04:00
Ned Deily 22f0483d44
Bpo-37644: update suspicious.csv for distutils/examples (GH-14885) 2019-07-21 20:01:56 +02:00
Raymond Hettinger 8dbe563aa6
bpo-37624: Document weight assumptions for random.choices() (GH-14855) 2019-07-19 01:56:42 -07:00
aldwinaldwin 8f040b7a9f bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
Move the Editors and IDE section out of the Unix section, to its own section.


https://bugs.python.org/issue37610
2019-07-18 18:23:17 -07:00
Joseph Fox-Rabinovitz bd26a4466b Docs: Correct formatting of a multiline code block (GH-13806) 2019-07-17 11:13:01 +03:00
sgal 1d8b04edfd bpo-37599: Remove a vague statement in documentation of Integer Objects (#14786)
* Remove a vague statement in documentation

* Remove another vague sentence

A sentence starting with "So it should be possible..." shouldn't be in the docs either.

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Include the removal of the previous line

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Remove an extra space
2019-07-16 08:15:17 -07:00
Ilya Kamenshchikov a0f7119f15 bpo-37352: Minor word-smithing for design.rst (GH #14730) 2019-07-16 08:13:38 -07:00
David Jones 6a61714cde Replace backquote with command substitution in subprocess doc example (GH-13941)
Replace backquotes with POSIXy command substitution in example.
2019-07-16 07:55:19 -07:00
Giovanni Cappellotto 52693c10e8 bpo-37284: Add note to sys.implementation doc (GH-14328)
Add a brief note to indicate that any new required attributes must go through the PEP process.





https://bugs.python.org/issue37284
2019-07-15 07:37:09 -07:00
Hai Shi 40d2226a69 Remove redundant docs of PyEval_EvalFrameEx (GH-14765) 2019-07-14 10:20:56 +02:00
Steve Dower 68c74d05c1
bpo-37571: Remove extra space in ctypes docs (GH14764) 2019-07-14 10:09:45 +02:00
Michele Angrisano 6b929580eb bpo-37571: Add 'b' to prevent the TypeError exception. (GH-14721)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
2019-07-14 09:55:11 +02:00
Carl Bordum Hansen 8efade91b1 bpo-36261: Improve example of the preamble field in email docs (GH-14751) 2019-07-14 09:46:18 +02:00
Zac Hatfield-Dodds dffca9e925 bpo-26967: fix flag grouping with allow_abbrev=False (GH-14316)
The `allow_abbrev` option for ArgumentParser is documented and intended to disable support for unique prefixes of --options, which may sometimes be ambiguous due to deferred parsing.

However, the initial implementation also broke parsing of grouped short flags, such as `-ab` meaning `-a -b` (or `-a=b`).  Checking the argument for a leading `--` before rejecting it fixes this.

This was prompted by pytest-dev/pytest#5469, so a backport to at least 3.8 would be great 😄  
And this is my first PR to CPython, so please let me know if I've missed anything!


https://bugs.python.org/issue26967
2019-07-13 22:35:58 -07:00
Sviatoslav Sydorenko e44184749c bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir (GH-1163)
Hi,

I've faced an issue w/ `mailbox.Maildir()`. The case is following:
1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty
2. I pass that folder path as an argument when instantiating `mailbox.Maildir()`
3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir

**Expected result:** subdirs are created during `Maildir()` instance creation.

**Actual result:** subdirs are assumed as existing which leads to exceptions during use.

**Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed.

**Fix:** This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.


https://bugs.python.org/issue30088
2019-07-13 07:47:14 -07:00
Giovanni Cappellotto dc3f99fa77 bpo-37548: Document range of atan, acos and asin (GH-14717) 2019-07-13 14:59:55 +01:00
Milan Oberkirch b5bbb8a740 bpo-37580: Fix typo in http.cookiejar documentation (GH-14731)
[bpo-37580](https://bugs.python.org/issue37580): Markup typo in http.cookiejar doc





https://bugs.python.org/issue37580
2019-07-13 03:17:16 -07:00
Robert DiPietro fb6c1f8d3b Fix typo in re.escape documentation (GH-14722) 2019-07-13 16:35:04 +08:00
Brett Cannon 0827064c95 bpo-37521: No longer treat insertion into sys.modules as optional in importlib examples (GH-14723)
Fix importlib examples to insert any newly created modules via importlib.util.module_from_spec() immediately into sys.modules instead of after calling loader.exec_module().

Thanks to Benjamin Mintz for finding the bug.


https://bugs.python.org/issue37521
2019-07-12 15:35:34 -07:00
Mariatta 7cbef72902 closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://bugs.python.org/issue37554
2019-07-11 10:31:19 -07:00
Tal Einat 79042ac434
bpo-34369: make kqueue.control() docs better reflect that timeout is positional-only (GH-9499) 2019-07-11 17:00:34 +03:00
Jeroen Demeyer 59ad110d7a bpo-37547: add _PyObject_CallMethodOneArg (GH-14685) 2019-07-11 17:59:05 +09:00
Benjamin Peterson 2a3d4d9c53
Document default parameter of .seek() in the signature. (GH-14691) 2019-07-10 19:43:04 -07:00
Victor Stinner 91b4f7ab7f
bpo-37526: Add support.catch_threading_exception() (GH-14664)
Context manager catching threading.Thread exception using
threading.excepthook.
2019-07-09 13:00:23 +02:00
Julien Palard 66b4150f6f
Doc: Fix example title. (GH-14639) 2019-07-08 23:08:07 +02:00
Julien Palard 2da622ff77
Doc: Fix: Proper UpperCamelCase and lowercase. (GH-14644)
Initial report by Michael Blankenship on docs@
2019-07-08 23:06:32 +02:00
Jeroen Demeyer 762f93ff2e bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) 2019-07-08 17:19:25 +09:00
Hai Shi f6cdd3ff68 bpo-37513: Change ValueError to TypeError in an example in ctypes doc (GH-14615) 2019-07-07 23:40:07 +08:00
Terry Jan Reedy a9b40e4546
bpo-37478: Add missing 'and'. (GH-14631) 2019-07-06 22:44:01 -04:00
Kyle Stanley 0717b4d9b3 bpo-37478: Specify possible exceptions for os.chdir() (GH-14611) 2019-07-06 21:20:15 -04:00
Terry Jan Reedy 6f2a8c0857
bpo-37456: Slash ('/') is now part of syntax. (GH-14627) 2019-07-06 18:13:02 -04:00
Terry Jan Reedy f8709e804d
bpo-37487: Fix PyList_GetItem index description. (GH-14623)
0 is a legal index.
2019-07-06 17:40:27 -04:00
Tal Einat fcf1d003bf
bpo-26806: add 30 to the recursion limit in IDLE's shell (GH-13944)
This is done to compensate for the extra stack frames added by
IDLE itself, which cause problems when setting the recursion limit
to low values.

This wraps sys.setrecursionlimit() and sys.getrecursionlimit()
as invisibly as possible.
2019-07-06 15:35:24 +03:00
Terry Jan Reedy 45bc61b971
bpo-37149: Replace dead link for online Tkinter reference (GH-14616)
Also fix a name misspelling.
2019-07-06 02:31:54 -04:00
Hai Shi 39a5d17a7f closes bpo-37508: Fix name of type in memory.rst. (GH-14604) 2019-07-05 21:03:13 -07:00
Victor Stinner 1da4462765
bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)
The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
2019-07-05 10:44:12 +02:00
Tim Hoffmann a55f75a6e3 Use OSError subclasses in os documentation (GH-14262) 2019-07-05 11:41:35 +03:00
thatneat 2f19e82fbe bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__ (GH-14545)
* bpo-37479: on Enum subclasses with mixins, __format__ uses overridden __str__
2019-07-04 11:28:37 -07:00
Victor Stinner b4e68960b9
bpo-37266: Add bpo number to the What's New entry (GH614584)
To get more info about this change.
2019-07-04 18:30:19 +02:00
Jeroen Demeyer 7f41c8e0dd bpo-37493: use _PyObject_CallNoArg in more places (GH-14575) 2019-07-04 19:35:31 +09:00
Jeroen Demeyer 196a530e00 bpo-37483: add _PyObject_CallOneArg() function (#14558) 2019-07-04 19:31:34 +09:00
aldwinaldwin b607d992e7 bpo-37459: importlib docs improperly reference get_resource_loader() (#14568)
* bpo-37459: importlib docs improperly reference get_resource_loader()
2019-07-03 17:58:45 -07:00
ILJI CHOI 0f6f73ff3c Fix typo in 3.9's Whats new. Pyton -> Python (GH-14567) 2019-07-02 19:36:01 -07:00
Hai Shi aeecf38066 bpo-37441: Fix wrong PyErr_SetImportErrorSubclass signature in doc (GH-14453) 2019-07-03 09:56:07 +08:00
Steve Dower e226e83d36
bpo-37363: Add audit events on startup for the run commands (GH-14524) 2019-07-01 16:03:53 -07:00
Vinay Sajip 0f4e813282
bpo-37470: Document more clearly the error handling for QueueHandler.emit(). (GH-14532) 2019-07-01 20:45:01 +01:00
Vinay Sajip e6b64b756f
bpo-37469: Document usability of SimpleQueue with QueueHandler and QueueListener. (GH-14521) 2019-07-01 18:45:07 +01:00
Victor Stinner 36242fd871
bpo-36763: Add PyConfig_SetWideStringList() (GH-14444) 2019-07-01 19:13:50 +02:00
Pierre Glaser ec6c1bd049 bpo-37209: Add pickle entry for 3.8 whatsnew (GH-14503) 2019-07-01 15:51:57 +02:00
Miro Hrončok 72cd653c4e bpo-10945: Drop support for bdist_wininst on non-Windows systems (GH-14506)
bdist_wininst depends on MBCS codec, unavailable on non-Windows,
and bdist_wininst have not worked since at least Python 3.2, possibly
never on Python 3.

Here we document that bdist_wininst is only supported on Windows,
and we mark it unsupported otherwise to skip tests.

Distributors of Python 3 can now safely drop the bdist_wininst .exe files
without the need to skip bdist_wininst related tests.
2019-07-01 14:12:40 +02:00
Vinay Sajip 84de34e39e
bpo-32934: Clarified meaning of 'capacity' for BufferingHandler and MemoryHandler. (GH-14498) 2019-07-01 12:41:21 +01:00
Pablo Galindo 4a2edc34a4 bpo-37221: Add PyCode_NewWithPosOnlyArgs to be used internally and set PyCode_New as a compatibility wrapper (GH-13959)
Add PyCode_NewEx to be used internally and set PyCode_New as a compatibility wrapper
2019-07-01 12:35:05 +02:00
Christian Heimes d1bd6e79da bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448)
Post-handshake authentication is required for conditional client cert authentication with TLS 1.3.


https://bugs.python.org/issue37440
2019-06-30 23:32:24 -07:00
Krishna Oza 12b436e3b0 bpo-36168: Lowercase the word "subsequent" in get_value doc (GH-14485)
Subsequent -> subsequent

https://bugs.python.org/issue36168
2019-06-30 23:04:20 -07:00
Andrew Svetlov 0d671c04c3
bpo-35621: Support running subprocesses in asyncio when loop is executed in non-main thread (GH-14344) 2019-06-30 12:54:59 +03:00
tmblweed eb97b9211e bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469)
* Added documentation for textwrap.dedent behavior.
* Remove an obsolete note about pre-2.5 behavior from the docstring.
2019-06-29 21:20:03 -07:00
Andre Delfino 3e6583061c Make StreamHandler.terminator more discoverable (GH-14359) 2019-06-29 22:59:49 +01:00
Andre Delfino 18a2fc6f23 Fix indentation in logging.handlers.setStream (GH-14358) 2019-06-29 22:57:39 +01:00
Brett Cannon f9f8e3ce70
bpo-37403: Touch up venv docs (GH-14458)
Add a versionadded for PS Core and note that `.venv` is a common virtual environment name.
2019-06-28 12:14:31 -07:00
Jeroen Demeyer b1263d5a60 bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228) 2019-06-28 18:49:00 +09:00
Hai Shi b4bee03087 bpo-37432: Doc: Fix signature of PyObject_Del() (GH-14430) 2019-06-28 18:02:56 +09:00
Steve Dower 44f91c388a
bpo-37390: Add audit event table to documentations (GH-14406)
Also updates some (unreleased) event names to be consistent with the others.
2019-06-27 10:47:59 -07:00
Carl Bordum Hansen 06a8916cf4 bpo-37376: pprint support for SimpleNamespace (GH-14318)
https://bugs.python.org/issue37376
2019-06-26 16:13:18 -07:00
Serhiy Storchaka 2d88e63bfc
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. (GH-14390) 2019-06-26 19:07:44 +03:00
Victor Stinner 69150669f2
bpo-37414: Remove sys.callstats() (GH-14398)
Remove the undocumented sys.callstats() function. Since Python 3.7,
it was deprecated and always returned None. It required a special
build option CALL_PROFILE which was already removed in Python 3.7.
2019-06-26 18:01:10 +02:00
Steve Dower 7a177c08ab
Improve Windows commands in tutorial (GH-14379) 2019-06-26 08:55:57 -07:00
Victor Stinner 689830ee62
bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)
The os.getcwdb() function now uses the UTF-8 encoding on Windows,
rather than the ANSI code page: see PEP 529 for the rationale. The
function is no longer deprecated on Windows.

os.getcwd() and os.getcwdb() now detect integer overflow on memory
allocations. On Unix, these functions properly report MemoryError on
memory allocation failure.
2019-06-26 17:31:12 +02:00
Victor Stinner 22eb689cf3
bpo-37388: Development mode check encoding and errors (GH-14341)
In development mode and in debug build, encoding and errors arguments
are now checked on string encoding and decoding operations. Examples:
open(), str.encode() and bytes.decode().

By default, for best performances, the errors argument is only
checked at the first encoding/decoding error, and the encoding
argument is sometimes ignored for empty strings.
2019-06-26 00:51:05 +02:00
Victor Stinner 3939c321c9
bpo-20443: _PyConfig_Read() gets the absolute path of run_filename (GH-14053)
Python now gets the absolute path of the script filename specified on
the command line (ex: "python3 script.py"): the __file__ attribute of
the __main__ module, sys.argv[0] and sys.path[0] become an absolute
path, rather than a relative path.

* Add _Py_isabs() and _Py_abspath() functions.
* _PyConfig_Read() now tries to get the absolute path of
  run_filename, but keeps the relative path if _Py_abspath() fails.
* Reimplement os._getfullpathname() using _Py_abspath().
* Use _Py_isabs() in getpath.c.
2019-06-25 15:02:43 +02:00
Xtreak 080b6b40fa bpo-37392: Update the dir(sys) in module tutorial (GH-14365) 2019-06-25 14:16:54 +02:00
Pablo Galindo de9b606c90
Fix minor spelling error in What's new for Python 3.8 (GH-14371) 2019-06-25 11:55:23 +01:00
Pablo Galindo b51b7137fa
bpo-35224: Add What's new entry for evaluation order in dict comprehensions (GH-14319) 2019-06-25 02:41:58 +01:00
Victor Stinner 36456df138
bpo-37392: Remove sys.setcheckinterval() (GH-14355)
Remove sys.getcheckinterval() and sys.setcheckinterval() functions.
They were deprecated since Python 3.2. Use sys.getswitchinterval()
and sys.setswitchinterval() instead.

Remove also check_interval field of the PyInterpreterState structure.
2019-06-25 03:01:08 +02:00
David K. Hess 9fc720e5e4 bpo-4963: Fix for initialization and non-deterministic behavior issues in mimetypes (GH-3062) 2019-06-24 16:46:59 -07:00
Xtreak 6793cce155 bpo-36889: Document asyncio Stream and StreamServer (GH-14203) 2019-06-24 21:16:58 +03:00
Steve Dower 60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
Gabe Appleton 2ac3bab2a6 bpo-37345: Add formal UDPLITE support (GH-14258)
At the moment you can definitely use UDPLITE sockets on Linux systems, but it would be good if this support were formalized such that you can detect support at runtime easily.

At the moment, to make and use a UDPLITE socket requires something like the following code:

```
>>> import socket
>>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136)
>>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136)
>>> a.bind(('localhost', 44444))
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 16)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 32)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.setsockopt(136, 10, 64)
>>> b.sendto(b'test'*256, ('localhost', 44444))
```

If you look at this through Wireshark, you can see that the packets are different in that the checksums and checksum coverages change.

With the pull request that I am submitting momentarily, you could do the following code instead:

```
>>> import socket
>>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
>>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
>>> a.bind(('localhost', 44444))
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(16)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(32)
>>> b.sendto(b'test'*256, ('localhost', 44444))
>>> b.set_send_checksum_coverage(64)
>>> b.sendto(b'test'*256, ('localhost', 44444))
```

One can also detect support for UDPLITE just by checking

```
>>> hasattr(socket, 'IPPROTO_UDPLITE')
```


https://bugs.python.org/issue37345
2019-06-24 02:58:56 -07:00
Ben Darnell 9ffca670ed asyncio: Fix docs for default event loop (#14308)
When the Windows default event loop changed, `asyncio-policy.rst` was updated but `asyncio-eventloop.rst` was missed.
2019-06-22 10:38:20 -07:00
Jörn Heissler c8a35417db bpo-35224: Reverse evaluation order of key: value in dict comprehensions (GH-14139)
… as proposed in PEP 572; key is now evaluated before value.





https://bugs.python.org/issue35224
2019-06-22 07:40:55 -07:00
Steve Dower f5690925df bpo-37351: Removes libpython38.a from standard Windows distribution (#14276) 2019-06-21 14:28:46 -07:00
Brad 8b2aa1fdde Use `python -m pip install` in porting guide and venv docs (GH-13257)
This is to help prevent people from accidentally installing into the wrong Python interpreter if they are not aware of which Python interpreter `pip` points to.
2019-06-21 11:20:21 -07:00
Aeros d0068000b2 Docs: Improved phrasing (GH-14069)
* Docs: Improved phrasing 

Removed usage of second person pronouns in the section and made the assumption of "uneasiness" in code style transition more neutral.

* Removed trailing whitespace on line 34
2019-06-20 21:43:07 -07:00
Victor Stinner c68e3fb15d Update What's New in Python 3.9 (GH-14253)
* Mention bpo of PyImport_Cleanup removal
* Fix bpo number of PyByteArray_Init removal
2019-06-20 13:41:25 -07:00
Hai Shi bc5caf88ca bpo-37342: Fix the incorrect nb_index's type in typeobj documentation (GH-14241)
It was listed as `binaryfunc`. It should be `unaryfunc`.
2019-06-19 20:32:23 -07:00
Victor Stinner af41c567af
Update What's New in Python 3.8 (GH-14239)
* Mention issue in which ByByteArray_Init() has been removed.
* Fix typo
2019-06-20 01:44:58 +02:00
Harmon 35068bd059 Add missing single quote in io.TextIOWrapper.reconfigure documentation (GH-14246)
Add a missing single quote character in the documentation for `io.TextIOWrapper.reconfigure`.
2019-06-19 14:01:26 -07:00
Vinay Sajip f06b569305
bpo-37331: Clarify format of socket handler messages in the documentation. (GH-14234) 2019-06-19 15:29:57 +01:00
Vinay Sajip 0150001653
bpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229) 2019-06-19 11:46:53 +01:00
Victor Stinner 987a0dcfa1
bpo-36710: Remove PyImport_Cleanup() function (GH-14221)
* Rename PyImport_Cleanup() to _PyImport_Cleanup() and move it to the
  internal C API. Add 'tstate' parameters.
* Remove documentation of _PyImport_Init(), PyImport_Cleanup(),
  _PyImport_Fini(). All three were documented as "For internal use
  only.".
2019-06-19 10:36:10 +02:00
Ivan Levkivskyi 809ff1181c
Document typing.ForwardRef (GH-14216) 2019-06-19 01:31:51 +01:00
Ivan Levkivskyi 47c2de7725
Document changes in PyNode_AddChild and PyParser_AddToken (GH-14214)
I didn't find any entries in the docs about these functions, so I just mentioned them, in "What's New".
2019-06-19 01:17:47 +01:00
Mike Gleen 6b9c204ee7 bpo-34903: Document that some strptime formats only require 1 digit (GH-14149)
For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.

This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.

bpo-34903
2019-06-18 19:14:57 +01:00
Cheryl Sabella 201bc2d18b bpo-5680: IDLE: Customize running a module (GH-13763)
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
2019-06-17 22:24:10 -04:00
Victor Stinner ac7b1a3f32
bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169)
aifc.openfp() alias to aifc.open(), sunau.openfp() alias to
sunau.open(), and wave.openfp() alias to wave.open() have been
removed. They were deprecated since Python 3.7.
2019-06-18 00:00:24 +02:00
Tal Einat 5bff3c86ab bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
Measure required height by quickly maximizing once per screen.
A search for a better method failed.
2019-06-17 15:41:00 -04:00
Cooper Lees 4acdbf11b1 bpo-34556: Add --upgrade-deps to venv module (#13100)
Add --upgrade-deps to venv module
- This allows for pip + setuptools to be automatically upgraded to the latest version on PyPI
- Update documentation to represent this change

bpo-34556: Add --upgrade to venv module
2019-06-17 19:18:13 +01:00
Vinay Sajip ca7b504a4d
bpo-37111: Add 'encoding' and 'errors' parameters to logging.basicCon… (GH-14008) 2019-06-17 17:40:52 +01:00
Victor Stinner 5352cc41fa
bpo-37194: Add PyObject_CallNoArgs() rationale (GH-14159)
Explain in the doc why PyObject_CallNoArgs() should be preferred over
other existing ways to call a function without any arguments.
2019-06-17 17:15:36 +02:00
Serhiy Storchaka 231aad3849
bpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147) 2019-06-17 16:57:27 +03:00
Victor Stinner 1ce2656f13
bpo-37194: Complete PyObject_CallXXX() docs (GH-14156)
Mention explicitly that PyObject_CallXXX() functions raise an
exception an failure.
2019-06-17 14:58:10 +02:00
Victor Stinner 2ff58a24e8
bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)
Add a new public PyObject_CallNoArgs() function to the C API: call a
callable Python object without any arguments.

It is the most efficient way to call a callback without any argument.
On x86-64, for example, PyObject_CallFunctionObjArgs(func, NULL)
allocates 960 bytes on the stack per call, whereas
PyObject_CallNoArgs(func) only allocates 624 bytes per call.

It is excluded from stable ABI 3.8.

Replace private _PyObject_CallNoArg() with public
PyObject_CallNoArgs() in C extensions: _asyncio, _datetime,
_elementtree, _pickle, _tkinter and readline.
2019-06-17 14:27:23 +02:00
Victor Stinner 8bf08ee45b
bpo-37312: Remove _dummy_thread and dummy_threading modules (GH-14143)
Remove _dummy_thread and dummy_threading modules. These modules
were deprecated since Python 3.7 which requires threading support.
2019-06-17 14:18:43 +02:00
Jeroen Demeyer 5600b5e1b2 bpo-28805: document METH_FASTCALL (GH-14079) 2019-06-17 02:03:22 +09:00
Julien Palard 552951563c
Doc: Remove an ugly space before a dot. (GH-14123) 2019-06-16 10:25:05 +02:00
Julien Palard cfa0394b97 Doc: Deprecation header: More precise wording. (GH-14109) 2019-06-15 10:21:37 -04:00
Alex Gaynor 6ef4d323bd Update link in colorsys docs to be https (GH-14062) 2019-06-15 07:09:36 -07:00
Julien Palard 7d23dbe6d1
Doc: Bump Sphinx verison. (#13785)
To reflect the one we're using in production.
2019-06-15 15:41:58 +02:00
Géry Ogam f475729a71 Update weakref.rst (GH-14098) 2019-06-15 04:33:23 -07:00
Victor Stinner 7efc526e5c
bpo-36707: Document "m" removal from sys.abiflags (GH-14090) 2019-06-15 03:24:41 +02:00
Victor Stinner bd5798f6d4
Document C API changes in What's New in Python 3.8 (GH-14092) 2019-06-14 19:43:43 +02:00
Victor Stinner 066e5b1a91
bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)
In a subinterpreter, spawning a daemon thread now raises an
exception. Daemon threads were never supported in subinterpreters.
Previously, the subinterpreter finalization crashed with a Pyton
fatal error if a daemon thread was still running.

* Add _thread._is_main_interpreter()
* threading.Thread.start() now raises RuntimeError if the thread is a
  daemon thread and the method is called from a subinterpreter.
* The _thread module now uses Argument Clinic for the new function.
* Use textwrap.dedent() in test_threading.SubinterpThreadingTests
2019-06-14 18:55:22 +02:00
Victor Stinner 212646cae6
bpo-37261: Document sys.unraisablehook corner cases (GH-14059)
Document reference cycle and resurrected objects issues in
sys.unraisablehook() and threading.excepthook() documentation.

Fix test.support.catch_unraisable_exception(): __exit__() no longer
ignores unraisable exceptions.

Fix test_io test_writer_close_error_on_close(): use a second
catch_unraisable_exception() to catch the BufferedWriter unraisable
exception.
2019-06-14 18:03:22 +02:00
Steve Dower 21a92f8cda
Implement Windows release builds in Azure Pipelines (GH-14065) 2019-06-14 08:29:20 -07:00
Géry Ogam 431478d5d7 Update concurrent.futures.rst (GH-14061)
This PR adds missing details in the [`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html) documentation:

* the mention that `Future.cancel` also returns `False` if the call finished running;
* the mention of the states for `Future` that did not complete: pending or running.
2019-06-14 07:39:43 -07:00
Michael Felt d0eeb936d8 bpo-37077: Add native thread ID (TID) for AIX (GH-13624)
This is the followup  for issue36084



https://bugs.python.org/issue37077
2019-06-13 15:34:46 -07:00
Makdon 95492032c4 bpo-6689: os.path.commonpath raises ValueError for different drives isn't documented (GH-14045)
It would raise ValueError("Paths don't have the same drive") if the paths on different drivers, which is not documented.


os.path.commonpath raises ValueError when the *paths* are in different drivers, but it is not documented.
Update the document according @Windsooon 's suggestion.
It actually raise ValueError according line 355 of [test of path](https://github.com/python/cpython/blob/master/Lib/test/test_ntpath.py) 


https://bugs.python.org/issue6689
2019-06-13 06:59:49 -07:00
Victor Stinner 6d22cc8e90
bpo-37261: Fix support.catch_unraisable_exception() (GH-14052)
The __exit__() method of test.support.catch_unraisable_exception
context manager now ignores unraisable exception raised when clearing
self.unraisable attribute.
2019-06-13 14:44:54 +02:00
Makdon 905e19a9bf bpo-37216: update version to 3.9 in mac using document (GH-13966) 2019-06-13 01:04:13 -04:00
Ned Deily 3a2883c313
Add 3.9 whatsnew file (GH-14040) 2019-06-12 23:31:45 -04:00
Victor Stinner a04ea4f92c
bpo-37253: Fix typo in PyCompilerFlags doc (GH-14036)
Remove ";" to fix Sphinx formatting.
2019-06-13 02:17:14 +02:00
Victor Stinner 2c9b498759
bpo-37253: Document PyCompilerFlags.cf_feature_version (GH-14019)
* Update PyCompilerFlags structure documentation.
* Document the new cf_feature_version field in the Changes in the C
  API section of the What's New in Python 3.8 doc.
2019-06-13 02:01:29 +02:00
David Carlier 5287022eee bpo-37160: Thread native ID NetBSD support (GH-13835) 2019-06-12 17:37:56 +02:00
Yao Zuo 405f648db7 bpo-32625: Updated documentation for EXTENDED_ARG. (GH-13985)
Python 3.6 changed the size of bytecode instruction, while the documentation for `EXTENDED_ARG` was not updated accordingly.
2019-06-12 06:46:09 +03:00
Guido van Rossum 10b55c1643 bpo-35766: Change format for feature_version to (major, minor) (GH-13992)
(A single int is still allowed, but undocumented.)



https://bugs.python.org/issue35766
2019-06-11 17:23:12 -07:00
Guido van Rossum 9b33ce48a7
bpo-35766: What's new in the ast and typing modules (#13984) 2019-06-11 13:42:35 -07:00
Serhiy Storchaka e042a4553e
Do not use explicit inheritance from object in the documentation. (GH-13936) 2019-06-10 13:35:52 +03:00
Antoine Pitrou c879ff247a bpo-36785: PEP 574 What's New entry (#13931) 2019-06-09 14:47:15 +02:00
Nick Coghlan b9438ceb20 Add some placeholder notes for major 3.8 features (GH-13927) 2019-06-09 11:07:42 +02:00
Raymond Hettinger e119b3d136
bpo-37178: Allow a one argument form of math.perm() (GH-13905) 2019-06-08 08:58:11 -07:00
Pablo Galindo de76c07a8c
bpo-37134: Add PEP570 notation to the signature of byte{array}.translate (GH-13874) 2019-06-07 00:38:41 +01:00
Zackery Spytz dc2476500d bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) 2019-06-06 22:39:23 +02:00
Barry Warsaw 4867eaa294
Add importlib.metadata to what's new. (#13855) 2019-06-05 19:40:19 -07:00
Pablo Galindo c4c421d619
bpo-37134: Use PEP570 syntax for sum() (GH-13851) 2019-06-06 00:11:46 +01:00
Ashwin Ramaswami c4c15ed7a2 bpo-35551: encodings update (GH-11446) 2019-06-05 18:18:06 -04:00
Pablo Galindo 54edb04aa6 bpo-37134: Add PEP570 notation to the documentation (GH-13743) 2019-06-05 13:24:28 -07:00
Victor Stinner 1e77ab0a35
bpo-33725, multiprocessing doc: rephase warning against fork on macOS (GH-13841)
Co-Authored-By: Barry Warsaw <barry@python.org>
2019-06-05 21:59:33 +02:00
Serhiy Storchaka 142566c028
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Turn deprecation warnings added in 3.8 into TypeError.
2019-06-05 18:22:31 +03:00
Victor Stinner ccf0efbb21 bpo-26836: Document os.memfd_create() name parameter (GH-13838)
https://bugs.python.org/issue26836
2019-06-05 03:24:52 -07:00
Benjamin Yeh d4cf099dff Fix documentation (GH-13721)
Based on the source code 4a686504eb/Lib/multiprocessing/pool.py (L755) AsyncResult.successful() raises a ValueError, not an AssertionError.
2019-06-05 02:08:04 -07:00
Julien Palard 59e7bbcaa4 Doc: Python 3.9 in sidebar and version switcher. (GH-13824) 2019-06-04 19:15:32 -04:00
Łukasz Langa 9ab2fb1c68
Bump to 3.9.0a0 2019-06-04 22:12:32 +02:00
Łukasz Langa 23d7ce7471 Python 3.8.0b1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAlz2r2cACgkQsmmV4xAl
 BWhasQ/9EDLL+KtFUdi3iMr7+C1UN/2u2v3OnOsZQA0WE7TfEebbf5GS4baN/pHk
 PslVY6kRqRfQIxjemXFpq52mn9+3SUE4m3avkgnUZMu8XEaUczM4IdcizGMO3qNr
 c1iz6BraJo8gZ1g+dNcRbEc89V9e1SzrBZOR9MXGjxxo0HHEPdjW9ptg1BtHq9To
 n4iivdQSnnxzP7D7SpItWPL/gFv90GBbXaTRerGUlmj/uwnBhzHB1fi4r+WDn8yR
 4AiFVSlUFpTXYOiH5A3MYQtLq8kH9AAmo6Bmj/73NvChxv7GV5v968+tlEWEK+/h
 UtTUEw8L/oSH74m8wd0q0tQdTe8VJgtwKyR6h5GLL8TLa73nN/jK4Koqirpc8mpK
 DcHVLpxHQ/yhPtAcQXp81qqJSbhnPOvbRjNQP5bHcNIl8p+OsF7N9z/tu6gmMorO
 k+f2OCOC0ZsG/EL7DPz6kG6+Cy5NhA+/IJ9I3Ayk6AsSjbzqtgai3bKKVF3s27r8
 OIZprMAVKsmsPpEfuSG8rshKxmLH5/n7YuwSuMmWXv06QspfG43zxp1VYq94zBoI
 wpBy8QxBwef7oDpMI+WgE/g8Prj1NmQuIy7co/pZDsOHeQWr96z90BcpSX8XKHKT
 9W829jFKoQEnGnuFgoUxacR8a4bQKVla5mVFvjUtGjb9GS9kJkk=
 =V2hy
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAlz2zD8QHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaIw/EACXkzdCOq5D/itTvFElnNWjlon8ot4toVEf
 zw4isSYiYS4B3dBI6+VyCZWNxR5F6fwfyhPLHf7CzPn+7Yp5+dX9//x0HqhNLQCY
 PmwuYG/4nWcww8UhUweGVI1u8Fjrw+LzLJPVyhLQia/TXUBfCFcggS2xo9S6mSsA
 isJr9RaCDaoit6ZjFIuo+sOn2YTx2eYBe6LlhlSx9zz0ayyy+ADqPeUq/hoEFDPD
 EXUOwsLJPo/vu7sFqKOhHBWtMCcnvkkbiBLrAmHS2vhKjl22zVez0lUiVxLUlhZT
 WcmfRkCtoBKu2rYbm85pt08fgF/CnHq9oO57yDBZ4j/Lv0HqQkp+/yZRzWqSSThw
 vw4z4Ur3l06ZMxsTH+Dd/xjqc41AlpedJNhuAgOf0URrbl4H48y5U6AG1vZWrpAk
 wUsTF1QGXL1SAam2pjI2cTpjRaCh3RK2wf0KPewxUpcvcRcGtGAbq+EFHHOFg2Lm
 AcxAuAEUXKcyJQnLtFiIOWJFttaRzAB6zq8sEL0kS1BfAEspqTk+ZdnDY1ajppqu
 7sb3/TGrxa+38Th5iVvUehHGQqrQYLORVn0w8PKUXunbUbv6AYoDJHKxiOUO4JsX
 L5jZEPjTeG0BjntTnvVYdgqPXAVbJr76LmlCPkPcmSruvXrfZP1OOi+ybepwbTpD
 8pw88nSTuA==
 =zOCJ
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.0b1'

Python 3.8.0b1
2019-06-04 21:53:26 +02:00
Petter Strandmark 001d63cefa bpo-35047: Update whatsnew/3.8 for better mock error message (GH-13746) 2019-06-04 21:34:48 +02:00
Łukasz Langa 3b5deb0116
Python 3.8.0b1 2019-06-04 19:44:34 +02:00
Abhilash Raj 46d88a1131 bpo-35805: Add parser for Message-ID email header. (GH-13397)
* bpo-35805: Add parser for Message-ID header.

This parser is based on the definition of Identification Fields from RFC 5322
Sec 3.6.4.

This should also prevent folding of Message-ID header using RFC 2047 encoded
words and hence fix bpo-35805.

* Prevent folding of non-ascii message-id headers.
* Add fold method to MsgID token to prevent folding.
2019-06-04 10:41:34 -07:00
Mario Corchero f0b5ae4567 bpo-30699: Improve example on datetime tzinfo instances (GH-4290)
* Improve example on tzinfo instances

Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.

* Simplify datetime with tzinfo example

Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.

Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
2019-06-04 17:18:10 +02:00
Łukasz Langa 7f9a2ae780
Revert "bpo-34037, asyncio: add BaseEventLoop.wait_executor_on_close (GH-13786)" (#13802)
This reverts commit 0f0a30f4da.
2019-06-04 13:03:20 +02:00
Raymond Hettinger 8f4bbb5d62
Fix grammar (GH-13801) 2019-06-04 03:40:23 -07:00
Ivan Levkivskyi 8bcf2629a2
More updates to the annotated assignments docs (GH-13794) 2019-06-04 11:37:46 +01:00
Raymond Hettinger 963eb0f473
bpo-35431: Drop the k <= n requirement (GH-13798) 2019-06-04 01:23:06 -07:00
Victor Stinner 0f0a30f4da
bpo-34037, asyncio: add BaseEventLoop.wait_executor_on_close (GH-13786)
Add BaseEventLoop.wait_executor_on_close attribute: true by default.

loop.close() now waits for the default executor to finish by default.
Set loop.wait_executor_on_close attribute to False to not wait for
the executor.
2019-06-03 23:31:04 +02:00
Christian Heimes 78c7d52779
bpo-37120: Add SSLContext.num_tickets (GH-13719)
Signed-off-by: Christian Heimes <christian@python.org>
2019-06-03 21:00:10 +02:00
Christian Heimes 47eb223406 bpo-36868: Fix what's new for SSLContext.hostname_checks_common_name (GH-13248)
What's new now mentions SSLContext.hostname_checks_common_name instead of SSLContext.host_flags.


https://bugs.python.org/issue36868
2019-06-03 11:51:27 -07:00
David Carlier 0b9956e916 bpo-37087: Adding native ID support for OpenBSD (GH-13654) 2019-06-03 17:43:33 +02:00
Julien Palard 141da44bb4
Doc fix: duplicate object description of email.message (GH-13742) 2019-06-03 17:17:03 +02:00
Victor Stinner 01ae897efd
Add credits to What's New in Python 3.8 (GH-13776)
* Credit myself and others.
* Complete asyncio changes.
2019-06-03 16:28:01 +02:00
Inada Naoki 91234a1636
bpo-26219: per opcode cache for LOAD_GLOBAL (GH-12884)
This patch implements per opcode cache mechanism, and use it in
only LOAD_GLOBAL opcode.

Based on Yury's opcache3.patch in bpo-26219.
2019-06-03 21:30:58 +09:00
Matthias Bussonnier 13136e83a6 bpo-36896: Clarify that some types constructors are unstable (GH-13271) 2019-06-03 02:43:21 +02:00
Jeroen Demeyer 9e3e06e582 bpo-36974: document PEP 590 (GH-13450) 2019-06-03 01:43:13 +02:00
Ivan Levkivskyi 82eac26a73
Update the annotated assignment docs (GH-13757) 2019-06-03 00:41:00 +01:00
Xtreak 0d70227e41 Fix typos in docs and docstrings (GH-13745) 2019-06-03 01:12:33 +02:00
Michele Angrisano e1179a5096 bpo-19184: Update the documentation of dis module. (GH-13652)
* bpo-19184: Update the documentation of dis module

* Explain the behavior of the number of arguments of RAISE_VARGARGS
  opcode.

* bpo-19184: Update blurb.

* bpo-19184: Fix typo in the dis Documentation.

* bpo-19184: Address review comments and improve the doc

* bpo-19184: Remove news file.
2019-06-02 23:34:12 +02:00
Michele Angrisano aca273e240 bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545)
* bpo-37014: Update docstring and Documentation of fileinput.FileInput()

* Explain the behavior of fileinput.FileInput() when reading stdin.

* Update blurb.

* bpo-37014: Fix typo in the docstring and documentation.
2019-06-02 23:01:49 +02:00
Mark Dickinson c52996785a
bpo-36027: Extend three-argument pow to negative second argument (GH-13266) 2019-06-02 10:24:06 +01:00
Serhiy Storchaka 5ae299ac78
bpo-37128: Add math.perm(). (GH-13731) 2019-06-02 11:16:49 +03:00
Anthony Sottile b7daabd711 Improve version added references in `typing` module docs (GH-13457) 2019-06-02 01:13:25 +01:00
Raymond Hettinger b7fade4f87
Put math.comb() docs is correct place alphabetically (GH-13734) 2019-06-01 15:01:46 -07:00
Marco Buttu 218e47b618 bpo-29414: Change 'the for statement is such an iterator' in Tutorial (GH-273) 2019-06-01 14:11:47 -07:00
Serhiy Storchaka bdbad71b9d
bpo-20092. Use __index__ in constructors of int, float and complex. (GH-13108) 2019-06-02 00:05:48 +03:00
Pablo Galindo 3b57f50efc
bpo-36842: Pass positional only parameters to code_new audit hook (GH-13707) 2019-06-01 21:18:48 +01:00
Evan 56624a99a9 bpo-28595: Allow shlex whitespace_split with punctuation_chars (GH-2071) 2019-06-01 20:09:22 +01:00
Serhiy Storchaka 2b843ac0ae
bpo-35431: Refactor math.comb() implementation. (GH-13725)
* Fixed some bugs.
* Added support for index-likes objects.
* Improved error messages.
* Cleaned up and optimized the code.
* Added more tests.
2019-06-01 22:09:02 +03:00
Pablo Galindo cd74e66a8c
bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726) 2019-06-01 18:08:04 +01:00
Anthony Shaw 059b9ea5ac bpo-31968: Documentation -- add clarification on the globals dict for exec() (GH-13140) 2019-06-01 08:51:58 -07:00
Stéphane Wirtel 66501058fe Doc: Correct the creation year and the credits of the Logo Programming language (GH-13520) 2019-06-01 07:41:33 -04:00
Mark Dickinson a0adffb902
Move whats-new entry for math.factorial to the math module section. (GH-13723) 2019-06-01 12:21:53 +01:00
Serhiy Storchaka 70c5f2ae6e
Use more PEP 570 syntax in the documentation. (GH-13720) 2019-06-01 11:38:24 +03:00
Serhiy Storchaka 2085bd0877
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) 2019-06-01 11:00:15 +03:00
Yash Aggarwal 4a686504eb bpo-35431: Implemented math.comb (GH-11414) 2019-06-01 00:21:27 -07:00
Windson yang 5ac0b988fd bpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13352) 2019-06-01 08:33:16 +02:00
Mario Corchero 354227a1e9 Add option to trace to run modules (GH-5134)
Adds a new option in trace that allows tracing runnable modules. It is
exposed as `--module module_name` as `-m` is already in use for another
argument.
2019-06-01 14:49:09 +10:00
Emmanuel Arias ed9f3562b6 bpo-37105: Add deprecated-remove information on stream doc (#13672)
* Add deprecated-remove information on stream doc

According to the code on streams.py the functions:
``open_connection()``, ``start_server()``, ``open_unix_connection()``,
``start_unix_server()`` are deprecated. I infor that on
documentation.
2019-05-31 23:48:57 +03:00
Cheryl Sabella a747c3a5ed
bpo-15115: Document deprecation of email.encoders in Python 3 (GH-5354) 2019-05-31 16:18:41 -04:00
Pablo Galindo aac4d0342c
bpo-26826: Expose copy_file_range in the os module (GH-7255) 2019-05-31 19:39:47 +01:00
Pablo Galindo 545a3b8814
Document changes for PyCode_New regarding PEP570 (GH-13706) 2019-05-31 19:33:41 +01:00
Akshay Sharma 4612671df2 bpo-25735: math.factorial doc should mention integer return type (GH-6420) 2019-05-31 12:41:17 -04:00
Christian Heimes 8cbb5b6625
bpo-26835: Add file sealing constants to fcntl (GH-13694)
Co-authored-by: nanjekyejoannah <nanjekyejoannah@gmail.com>
2019-05-31 18:32:33 +02:00
Makdon ffed76b6fc bpo-37094: Add example for TestCase.skipTest in unittest doc (GH-13645)
Also includes other minor test skipping doc improvements.


https://bugs.python.org/issue37094
2019-05-31 09:19:11 -07:00
Pablo Galindo ed222a74a0
Update data model docs to include missing attributes for code objects (GH-13696)
Include and document co_posonlyargcount and co_kwonlyargcount
2019-05-31 12:13:04 +01:00
Christian Heimes c7f7069e77
bpo-34271: Add ssl debugging helpers (GH-10031)
The ssl module now can dump key material to a keylog file and trace TLS
protocol messages with a tracing callback. The default and stdlib
contexts also support SSLKEYLOGFILE env var.

The msg_callback and related enums are private members. The feature
is designed for internal debugging and not for end users.

Signed-off-by: Christian Heimes <christian@python.org>
2019-05-31 11:44:05 +02:00
Ivan Levkivskyi 4c23aff065
bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`.

As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility.

The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.
2019-05-31 00:10:07 +01:00
Anthony Sottile 2a58b0636d bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)
https://bugs.python.org/issue5028
2019-05-30 15:06:32 -07:00
Matthias Bussonnier eea47e0939 bpo-36953: Delay removal of ABCs from collections. (GH-13409)
Bump the removal to 3.9, indicate collections.abc available since 3.3,
replace version-changed directive to deprecated-removed.


https://bugs.python.org/issue36953
2019-05-30 14:45:48 -07:00
Antti Haapala 2f5b9dcc0a bpo-30969: Fix docs about the comparison in absence of __contains__ (GH-2761) 2019-05-30 16:19:28 -04:00
Andrew Carr 1e36f75d63 bpo-5028: fix doc bug for tokenize (GH-11683)
https://bugs.python.org/issue5028
2019-05-30 12:31:51 -07:00
Xtreak 1b69c09248 Fix audit event typo : urllib.request -> urllib.Request (GH-13550)
As per the PEP and the [audit event raised](13d4e6a4a0/Lib/urllib/request.py (L524)) in urllib.request this should be `urllib.Request`

cc: @zooba
2019-05-30 10:58:27 -07:00
Alex Grönholm 98ef92002e bpo-36999: Add asyncio.Task.get_coro() (GH-13680)
https://bugs.python.org/issue36999
2019-05-30 08:30:09 -07:00