summaryrefslogtreecommitdiffstats
path: root/Doc
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39320: Handle unpacking of **values in compiler (GH-18141)Mark Shannon2020-01-271-14/+7
| | | | | | | | | | | | | * 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.
* bpo-36018: Add another example for NormalDist() (#18191)Raymond Hettinger2020-01-261-0/+36
|
* bpo-39374: Updated sorting documentation (GH-18177)Juhana Jauhiainen2020-01-251-4/+6
|
* bpo-36654: Add examples for using tokenize module programmically (#12947)Windson yang2020-01-251-0/+19
|
* bpo-15243: Document __prepare__ as classmethod (GH-17124)alclarks2020-01-251-1/+2
|
* Update 3.8.rst (GH-18173)fireattack2020-01-251-1/+1
| | | Fixed the name of the contributor (@selik).
* bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)Paulo Henrique Silva2020-01-251-1/+2
|
* bpo-39395: putenv() and unsetenv() always available (GH-18135)Victor Stinner2020-01-242-24/+27
| | | | | | | | 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.
* bpo-39413: Implement os.unsetenv() on Windows (GH-18163)Victor Stinner2020-01-242-0/+6
| | | The os.unsetenv() function is now also available on Windows.
* bpo-39361: Document the removal of PyTypeObject.tp_print (GH-18125)Ammar Askar2020-01-241-0/+5
|
* bpo-39429: Add a new "Python Development Mode" doc page (GH-18132)Victor Stinner2020-01-2412-47/+262
|
* bpo-17005: Minor improvements to the documentation of TopologicalSorter ↵Pablo Galindo2020-01-231-75/+67
| | | | (GH-18155)
* bpo-39431: Also mention nonlocal in assignment quirk (GH-17375)Shanavas M2020-01-231-4/+4
|
* bpo-17005: Add a class to perform topological sorting to the standard ↵Pablo Galindo2020-01-233-0/+215
| | | | | library (GH-11583) Co-Authored-By: Tim Peters <tim.peters@gmail.com>
* bpo-39320: Handle unpacking of *values in compiler (GH-17984)Mark Shannon2020-01-231-28/+9
| | | | | | | | * 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.
* bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)William Woodruff2020-01-231-1/+4
| | | `is_tarfile()` now supports `name` being a file or file-like object.
* bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035)Dong-hee Na2020-01-222-27/+7
|
* Revert "bpo-39413: Implement os.unsetenv() on Windows (GH-18104)" (GH-18124)Victor Stinner2020-01-222-6/+0
| | | This reverts commit 56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.
* bpo-39353: Deprecate the binhex module (GH-18025)Victor Stinner2020-01-223-0/+22
| | | | | | | | Deprecate binhex4 and hexbin4 standards. Deprecate the binhex module and the following binascii functions: * b2a_hqx(), a2b_hqx() * rlecode_hqx(), rledecode_hqx() * crc_hqx()
* bpo-39377: json: Update doc about the encoding option. (GH-18076)Inada Naoki2020-01-222-8/+11
| | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* PyLong_AsLongLong() docs should say 'long long' (#18082)Keith Erskine2020-01-211-1/+1
|
* bpo-39413: Implement os.unsetenv() on Windows (GH-18104)Victor Stinner2020-01-212-0/+6
| | | | | The os.unsetenv() function is now also available on Windows. It is implemented with SetEnvironmentVariableW(name, NULL).
* improve the documentation of the LOAD_METHOD and CALL_METHOD (GH-18079)Carl Friedrich Bolz-Tereick2020-01-211-8/+10
|
* bpo-39383: Mention Darwin as a potential value for platform.system() (GH-18054)Peter Bittner2020-01-201-3/+2
|
* Fix asyncio.get_event_loop() documentation (GH-18051)Andrew Svetlov2020-01-201-2/+4
| | | Mention that the function implicitly creates new event loop only if called from the main thread.
* Fix Lock.locked() to remove extra bold highlighting (#18042)Grant Jenks2020-01-171-0/+1
|
* bpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)Victor Stinner2020-01-162-6/+18
| | | | | | | 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.
* bpo-39350: Remove deprecated fractions.gcd() (GH-18021)Victor Stinner2020-01-162-12/+4
| | | | Remove fractions.gcd() function, deprecated since Python 3.5 (bpo-22486): use math.gcd() instead.
* bpo-39351: Remove base64.encodestring() (GH-18022)Victor Stinner2020-01-162-12/+5
| | | | | Remove base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1: use base64.encodebytes() and base64.decodebytes() instead.
* bpo-39348: Fix code highlight for the SOCK_NONBLOCK example (GH-18018)Oz N Tiram2020-01-151-1/+3
| | | | | | | | | | | 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
* bpo-37958: Adding get_profile_dict to pstats (GH-15495)Daniel Olshansky2020-01-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix typo in multiprocessing.pool.AsyncResult.successful doc. (GH-17932)Antoine2020-01-151-1/+1
| | | | | | | | 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.
* bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)Victor Stinner2020-01-151-0/+2
| | | | | | | 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.
* Fix AsyncMock base class in the docs (GH-18008)Elena Oat2020-01-151-1/+1
|
* bpo-39329: Add timeout parameter for smtplib.LMTP constructor (GH-17998)Dong-hee Na2020-01-142-1/+8
|
* bpo-38901: Allow setting a venv's prompt to the basename of the current ↵Vinay Sajip2020-01-141-1/+2
| | | | | | 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.
* Fix documentation in code.py (GH-17988)Kyle Pollina2020-01-141-1/+1
|
* bpo-39322: Add gc.is_finalized to check if an object has been finalised by ↵Pablo Galindo2020-01-142-0/+25
| | | | the gc (GH-17989)
* bpo-39048: Look up __aenter__ before __aexit__ in async with (GH-17609)Géry Ogam2020-01-141-1/+1
| | | | | | * 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
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-0/+21
| | | | | | | | 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.
* bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 (GH-17958)Dong-hee Na2020-01-142-0/+13
|
* bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959)Dong-hee Na2020-01-132-0/+14
|
* bpo-20443: Update What's New In Python 3.9 (GH-17986)Victor Stinner2020-01-131-1/+1
| | | The sys.argv[0] change has been reverted.
* bpo-39310: Add math.ulp(x) (GH-17965)Victor Stinner2020-01-133-8/+44
| | | | Add math.ulp(): return the value of the least significant bit of a float.
* bpo-39313: Add an option to RefactoringTool for using exec as a function ↵Batuhan Taşkaya2020-01-121-1/+1
| | | | | | | | (GH-17967) https://bugs.python.org/issue39313 Automerge-Triggered-By: @pablogsal
* bpo-3530: Add advice on when to correctly use fix_missing_locations in the ↵Batuhan Taşkaya2020-01-121-1/+9
| | | | | | AST docs (GH-17172) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39288: Add examples to math.nextafter() documentation (GH-17962)Victor Stinner2020-01-121-0/+7
|
* bpo-12159: Document sys.maxsize limit in len() function reference (GH-17934)Zac Hatfield-Dodds2020-01-121-0/+5
|
* bpo-39288: Add math.nextafter(x, y) (GH-17937)Victor Stinner2020-01-122-0/+15
| | | Return the next floating-point value after x towards y.
* bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)Dong-hee Na2020-01-112-0/+15
| | | | | 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.