Commit Graph

10188 Commits

Author SHA1 Message Date
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
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
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
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
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
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
idomic 5305cc9dbf bpo-39128: Added happy_eyeballs_delay, interleave to function signature (GH-18315) 2020-02-10 10:48:40 +01: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
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
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
Julien Palard 58a4054760
Doc: Fix s/pseudo random/pseudo-random/ (GH-18289) 2020-01-31 10:50:14 +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
Rémi Lapeyre 2cca8efe46 bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412) 2020-01-28 21:47:03 +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
Windson yang 4b09dc79f4 bpo-36654: Add examples for using tokenize module programmically (#12947) 2020-01-25 22:23:00 +03: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
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
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
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
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 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
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
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
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
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
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
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
Fabio Sangiovanni e28aff54d9 bpo-33961: Adjusted dataclasses docs to correct exceptions raised. (GH-7917) (GH-17677) 2019-12-25 17:45:30 -05: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
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
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
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
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
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
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
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 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
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
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
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
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
Raymond Hettinger 04c79d6088
bpo-38678: Improve argparse example in tutorial (GH-17207) 2019-11-17 22:06:19 -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
HongWeipeng 84f2528d48 Fix the description of isdatadescriptor in inspect.rst (#16645) 2019-11-15 23:47:26 +02: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
Benjamin Peterson 3ccdd9b180
closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069) 2019-11-13 19:08:50 -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
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
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