Commit Graph

23558 Commits

Author SHA1 Message Date
Ruben Vorderman 23c0fb8edd
bpo-41586: Add pipesize parameter to subprocess & F_GETPIPE_SZ and F_SETPIPE_SZ to fcntl. (GH-21921)
* Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module
* Add pipesize parameter for subprocess.Popen class

This will allow the user to control the size of the pipes.
On linux the default is 64K. When a pipe is full it blocks for writing.
When a pipe is empty it blocks for reading. On processes that are
very fast this can lead to a lot of wasted CPU cycles. On a typical
Linux system the max pipe size is 1024K which is much better.
For high performance-oriented libraries such as xopen it is nice to
be able to set the pipe size.

The workaround without this feature is to use my_popen_process.stdout.fileno() in
conjuction with fcntl and 1031 (value of F_SETPIPE_SZ) to acquire this behavior.
2020-10-19 16:30:02 -07:00
Jakub Stasiak f85658a098
bpo-40901: Describe what "interface name" means on Windows (GH-20694) 2020-10-19 23:30:58 +01:00
Alex Gaynor 3a8fdb2879
bpo-41784: make PyUnicode_AsUTF8AndSize part of the limited API (GH-22252) 2020-10-19 23:17:50 +01:00
Zackery Spytz 4dfb190a33
bpo-41217: Fix incorrect note in the asyncio.create_subprocess_shell() docs (GH-21360)
On Windows, the default asyncio event loop is ProactorEventLoop (as of 3.8).
2020-10-19 23:08:34 +01:00
Michel Samia 33242a9328
bpo-41292: Fixes dead link to cx_freeze from Windows FAQ (GH-21463) 2020-10-19 23:02:43 +01:00
abdo 5d9e657517
Link to the msvcrt module from the Windows FAQ (#22268) 2020-10-19 22:46:21 +01:00
Irit Katriel fa8748271a
bpo-38320: Clarify that expectedFailure is satisfied by either failure or error of the test. (GH-22740) 2020-10-19 22:27:16 +01:00
Saiyang Gou ebc8c38287
bpo-41192: Fix some broken anchors for audit event entries (#21310) 2020-10-19 10:52:42 -04:00
Batuhan Taskaya 155938907c
bpo-40484: Document compiler flags under AST module (GH-19885)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-10-19 02:14:11 +01:00
Shantanu 67f04878de
3.9 whatsnew: fix bpo issue for AST change (GH-22742) 2020-10-18 18:39:26 +03:00
Andre Delfino 975d10a4f8
[doc] Add mentions of PEP 613 (TypeAlias) to docs (GH-22733) 2020-10-16 19:34:01 -07:00
Zackery Spytz a22a19f354
bpo-40341: Remove some "discouraged solutions" in Doc/faq/programming.rst (GH-22726) 2020-10-16 11:44:17 -07:00
Saiyang Gou cf693e537d
Document that `test.support.bytecode_helper` is new in 3.9 (GH-22618) 2020-10-15 16:06:23 -03:00
Raymond Hettinger b67cbbda3a
Minor clarification (GH-22708) 2020-10-14 23:41:55 -07:00
Raymond Hettinger 302b6166fb
Update timings for the final release (GH-22697) 2020-10-14 10:04:04 -07:00
Hai Shi c5b049b91c
bpo-39337: encodings.normalize_encoding() now ignores non-ASCII characters (GH-22219) 2020-10-14 17:43:31 +02:00
Raymond Hettinger f2bd04f689
Improve recipe readability (GH-22685) 2020-10-13 16:41:26 -07:00
Raymond Hettinger 8b2ff4c03d
Add recipe for a version of random() with a larger population (GH-22664) 2020-10-13 11:54:21 -07:00
Vladimir Matveev cfb0f57ff8
bpo-41756: Export PyGen_Send and wrap it in if-defs (#22677) 2020-10-13 10:26:51 -07:00
Saiyang Gou ba06a70c82
Fix typo in "Context manager types" section in typing.rst (GH-22676)
Fix typo in the "Context manager types" section in `typing.rst`.

Automerge-Triggered-By: @gvanrossum
2020-10-12 16:34:33 -07:00
Vladimir Matveev 24a54c0bd4
Delete PyGen_Send (#22663) 2020-10-12 12:10:42 -07:00
Andre Delfino 8adf8d1ec4
[doc] Remove mention of async and await as soft keywords (GH-22144) 2020-10-12 14:52:30 +01:00
Anthony Sottile d5752aa5c9
Fix .. code-block :: directives in decimal.rst (GH-22571) 2020-10-11 19:26:50 +01:00
Gaurav Kamath 8197a93208
Fix typo (GH-22582)
/af/of/s

Automerge-Triggered-By: @Mariatta
2020-10-11 11:13:43 -07:00
abdo 0ff8a3b374
Fix typo in typing.rst (GH-22625) 2020-10-11 11:40:21 +05:30
Xie Yanbo a42759351b
Fix incorrect parameter name (GH-22613)
Automerge-Triggered-By: @Mariatta
2020-10-09 19:38:43 -07:00
Vladimir Matveev 037245c5ac
bpo-41756: Add PyIter_Send function (#22443) 2020-10-09 17:15:15 -07:00
Serhiy Storchaka e2ec0b27c0
bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)
Remove complex special methods __int__, __float__, __floordiv__,
__mod__, __divmod__, __rfloordiv__, __rmod__ and __rdivmod__
which always raised a TypeError.
2020-10-09 14:14:37 +03:00
Phil Elson 35f041dd01
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
`site.getusersitepackages()` returns the location of the user-specific site-packages directory
even when the user-specific site-packages is disabled.

```
$ python -s -m site
sys.path = [
    '/home/user/conda/lib/python37.zip',
    '/home/user/conda/lib/python3.7',
    '/home/user/conda/lib/python3.7/lib-dynload',
    '/home/user/conda/lib/python3.7/site-packages',
]
USER_BASE: '/home/user/.local' (exists)
USER_SITE: '/home/user/.local/lib/python3.7/site-packages' (doesn't exist)
ENABLE_USER_SITE: False
```

It was not practical to prevent the function from returning None if user-specific site-packages are disabled, since there are other uses of the function which are relying on this behaviour (e.g. `python -m site`).
2020-10-08 15:37:46 +09:00
Raymond Hettinger 4e0ce82058
Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584)
This reverts commit 58a7da9e12.
2020-10-07 16:43:44 -07:00
Mikhail Golubev 4f3c25043d
bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
2020-10-07 14:44:31 -07:00
Batuhan Taskaya 044a1048ca
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.

For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
2020-10-06 13:03:02 -07:00
Ben Avrahami bef7d299eb
bpo-41905: Add abc.update_abstractmethods() (GH-22485)
This function recomputes `cls.__abstractmethods__`.
Also update `@dataclass` to use it.
2020-10-06 10:40:50 -07:00
Brett Cannon d02d824e05
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (#22505) 2020-10-05 09:42:21 -07:00
Terry Jan Reedy 060937da98
bpo-41774: Tweak new programming FAQ entry (GH-22562)
Remove mention of space in "remove multiple items from list".
2020-10-05 10:31:44 -04:00
Serhiy Storchaka dcc54215ac
bpo-41936. Remove macros Py_ALLOW_RECURSION/Py_END_ALLOW_RECURSION (GH-22552) 2020-10-05 12:32:00 +03:00
Fidget-Spinner 8e1dd55e63
bpo-41428: Documentation for PEP 604 (gh-22517) 2020-10-04 21:40:52 -07:00
scoder 40db798692
bpo-41892: Clarify that an example in the ElementTree docs explicitly avoids modifying an XML tree while iterating over it. (GH-22464) 2020-10-04 19:13:46 -04:00
Irit Katriel 1ed5443526
bpo-41898: add caveat on root logger seeing all messages in assertLogs doc (GH-22526) 2020-10-04 14:16:04 +01:00
Batuhan Taskaya e799aa8b92
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Also document that eval() does this (the same way).
2020-10-03 17:46:44 -07:00
Andre Delfino 7f54e563dc
[doc] Use list[int] instead of List[int] (etc.) in a few more places (GH-22524)
This changes a few occurrences left behind by #22340.

Automerge-Triggered-By: @gvanrossum
2020-10-03 15:10:59 -07:00
Andre Delfino 3fe6148937
[doc] Fix link to abc.collections.Iterable (GH-22520)
Missed this occurrence before, sorry. Also changed "the PEP" to "PEP".

Automerge-Triggered-By: @gvanrossum
2020-10-03 08:51:13 -07:00
Ram Rachum f97e42ef4d
bpo-40833: Clarify Path.rename doc-string regarding relative paths (GH-20554) 2020-10-03 12:52:13 +03:00
Andre Delfino d4b9edd505
[doc] Fix link to abc.collections.Iterable (GH-22502)
Automerge-Triggered-By: @gvanrossum
2020-10-02 16:15:28 -07:00
Andre Delfino bd71a43340
Fix is_typeddict markup (#22501) 2020-10-02 15:36:26 -07:00
Campbell Barton 20ce62f009
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291) 2020-10-02 19:18:01 +03:00
Victor Stinner 583ee5a5b1
bpo-41692: Deprecate PyUnicode_InternImmortal() (GH-22486)
The PyUnicode_InternImmortal() function is now deprecated and will be
removed in Python 3.12: use PyUnicode_InternInPlace() instead.
2020-10-02 14:49:00 +02:00
Andre Delfino c8bb24166e
[doc] Update references to NumPy (GH-22458)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
2020-10-01 16:22:14 -07:00
Robert Smallshire 58a7da9e12
bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)
* bpo-26680: Adds support for int.is_integer() for compatibility with float.is_integer().

The int.is_integer() method always returns True.

* bpo-26680: Adds a test to ensure that False.is_integer() and True.is_integer() are always True.

* bpo-26680: Adds Real.is_integer() with a trivial implementation using conversion to int.

This default implementation is intended to reduce the workload for subclass
implementers. It is not robust in the presence of infinities or NaNs and
may have suboptimal performance for other types.

* bpo-26680: Adds Rational.is_integer which returns True if the denominator is one.

This implementation assumes the Rational is represented in it's
lowest form, as required by the class docstring.

* bpo-26680: Adds Integral.is_integer which always returns True.

* bpo-26680: Adds tests for Fraction.is_integer called as an instance method.

The tests for the Rational abstract base class use an unbound
method to sidestep the inability to directly instantiate Rational.
These tests check that everything works correct as an instance method.

* bpo-26680: Updates documentation for Real.is_integer and built-ins int and float.

The call x.is_integer() is now listed in the table of operations
which apply to all numeric types except complex, with a reference
to the full documentation for Real.is_integer().  Mention of
is_integer() has been removed from the section 'Additional Methods
on Float'.

The documentation for Real.is_integer() describes its purpose, and
mentions that it should be overridden for performance reasons, or
to handle special values like NaN.

* bpo-26680: Adds Decimal.is_integer to the Python and C implementations.

The C implementation of Decimal already implements and uses
mpd_isinteger internally, we just expose the existing function to
Python.

The Python implementation uses internal conversion to integer
using to_integral_value().

In both cases, the corresponding context methods are also
implemented.

Tests and documentation are included.

* bpo-26680: Updates the ACKS file.

* bpo-26680: NEWS entries for int, the numeric ABCs and Decimal.

Co-authored-by: Robert Smallshire <rob@sixty-north.com>
2020-10-01 17:30:08 +01:00
Max Smolens 63298930fb
Fix grammar in secrets module documentation (GH-22467)
From `In particularly,` to `In particular,`
2020-09-30 15:05:51 -07:00