Mark Shannon
f333ab0f2e
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160)
2021-07-15 14:37:57 +01:00
Łukasz Langa
b83861f026
bpo-42073: allow classmethod to wrap other classmethod-like descriptors ( #27115 )
...
Patch by Erik Welch.
bpo-19072 (#8405 ) allows `classmethod` to wrap other descriptors, but this does
not work when the wrapped descriptor mimics classmethod. The current PR fixes
this.
In Python 3.8 and before, one could create a callable descriptor such that this
works as expected (see Lib/test/test_decorators.py for examples):
```python
class A:
@myclassmethod
def f1(cls):
return cls
@classmethod
@myclassmethod
def f2(cls):
return cls
```
In Python 3.8 and before, `A.f2()` return `A`. Currently in Python 3.9, it
returns `type(A)`. This PR make `A.f2()` return `A` again.
As of #8405 , classmethod calls `obj.__get__(type)` if `obj` has `__get__`.
This allows one to chain `@classmethod` and `@property` together. When
using classmethod-like descriptors, it's the second argument to `__get__`--the
owner or the type--that is important, but this argument is currently missing.
Since it is None, the "owner" argument is assumed to be the type of the first
argument, which, in this case, is wrong (we want `A`, not `type(A)`).
This PR updates classmethod to call `obj.__get__(type, type)` if `obj` has
`__get__`.
Co-authored-by: Erik Welch <erik.n.welch@gmail.com>
2021-07-15 15:16:19 +02:00
Irit Katriel
641345d636
bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043)
2021-07-15 13:13:12 +01:00
Leonardo Freua
a0551059ba
Remove unnecessary pass statement in msvccompiler.py (GH-27123)
2021-07-15 12:59:01 +02:00
andrei kulakov
b39eea06d1
bpo-42799: fnmatch module: bump up size of lru_cache for patterns (GH-27084)
2021-07-15 12:53:26 +02:00
Elisha Hollander
3527569f1c
Remove unnecessary test for xc == 1
in _pydecimal (GH-27102)
...
- if `xc == 1` then the function returns on line 2140;
- other assignments to `xc` are inside the `y.sign == 1` condition block which always returns early
2021-07-15 12:48:46 +02:00
Tzu-ping Chung
28544609cb
Fix osx_framework_user include to match distutils ( #27093 )
2021-07-15 11:44:04 +02:00
Jack DeVries
2693132292
bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131)
2021-07-14 17:38:42 -07:00
Vinay Sajip
3b8075f907
bpo-44473: Update docstring and documentation for QueueHandler.prepar… (GH-27140)
...
…e().
2021-07-14 17:06:48 -07:00
Shane Harvey
d59d7374a3
bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079)
2021-07-14 23:53:15 +01:00
Pablo Galindo Salgado
2b47af6398
Add release highlights for the 3.10 what's new document (GH-27150)
2021-07-14 23:19:55 +01:00
Erlend Egeberg Aasland
81b8c0a385
Fix docstring typo in sqlite3.Connection.executescript/sqlite3.Cursor.executescript (GH-27147)
...
Both `executescript` methods contain the same docstring typo:
_"Executes a multiple SQL statements at once."_ => _"Executes multiple SQL statements at once."_
Automerge-Triggered-By: GH:pablogsal
2021-07-14 14:54:37 -07:00
Jack DeVries
1ca27f2647
bpo-44639: fix typo in sqlite.rst (transation => transaction) (GH-27145)
...
To my understanding, this is supposed to say "transaction".
See the relevant source:
a158b20019/Modules/_sqlite/connection.c (L1434-L1467)
2021-07-14 14:39:54 -07:00
Serhiy Storchaka
a158b20019
bpo-44632: Fix support of TypeVar in the union type (GH-27139)
...
int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.
2021-07-14 20:09:15 +03:00
Serhiy Storchaka
b81cac0560
bpo-44635: Convert None to NoneType in the union type constructor (GH-27136)
2021-07-14 19:54:54 +03:00
Erlend Egeberg Aasland
05162993fe
bpo-42064: Move sqlite3
exceptions to global state, part 2 of 2 (GH-26884)
...
Automerge-Triggered-By: GH:encukou
2021-07-14 04:26:44 -07:00
Mark Shannon
e5862f79c1
bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109)
2021-07-14 10:08:38 +01:00
Serhiy Storchaka
f572cbf1fa
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
...
if it is called with a sequence or set, but not list or tuple.
2021-07-14 08:19:18 +03:00
Serhiy Storchaka
81989058de
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)
...
* Fix issubclass() for None.
E.g. issubclass(type(None), int | None) returns now True.
* Fix issubclass() for virtual subclasses.
E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
* Fix crash in isinstance() if the check for one of items raises exception.
2021-07-14 07:35:39 +03:00
T. Wouters
0093876328
bpo-44630: Fix assertion errors in csv module (GH-27127)
...
Fix incorrect handling of exceptions when interpreting dialect objects in
the csv module. Not clearing exceptions between calls to
PyObject_GetAttrString() causes assertion failures in pydebug mode (or with
assertions enabled).
Add a minimal test that would've caught this (passing None as dialect, or
any object that isn't a csv.Dialect subclass, which the csv module allows
and caters to, even though it is not documented.) In pydebug mode, the test
triggers the assertion failure in the old code.
Contributed-By: T. Wouters [Google]
2021-07-13 15:56:45 -07:00
Serhiy Storchaka
054e9c84ac
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
...
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-07-13 22:27:50 +01:00
Konstantin-Glukhov
0ee0a740e1
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092)
2021-07-13 20:21:48 +01:00
Clemens Brunner
6252670732
Fix typos in Mac/README.rst ( #27108 )
2021-07-13 18:25:12 +02:00
andrei kulakov
3b5b99da4b
bpo-43126: Expand docs on io.IOBase.readlines() method ( #27061 )
...
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-13 16:07:56 +02:00
Kevin Follstad
48a5aa7f12
bpo-44514: Add doctest testcleanup for configparser and bz2 ( #26909 )
...
Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.
2021-07-13 15:57:05 +02:00
jsnklln
2924bb1a56
bpo-38741: Definition of multiple ']' in header configparser (GH-17129)
...
Co-authored-by: Jason Killen <jason.killen@windsorcircle.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2021-07-13 15:54:06 +02:00
andrei kulakov
d4a5f0b659
bpo-35113: clean up duplicate import and comment ( #27073 )
2021-07-13 15:42:56 +02:00
Elisha Hollander
62d55a4d11
Remove unnecessary pass statements (GH-27103)
2021-07-13 15:02:30 +02:00
Ammar Askar
9c3eaf88dc
bpo-43950: Add documentation for PEP-657 (GH-27047)
...
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2021-07-13 01:29:39 +01:00
Barry Warsaw
f6954cdfc5
bpo-44613: Make importlib.metadata non-provisional ( #27101 )
...
* importlib.metadata is no longer provisional as of 3.10
* Add NEWS entry
2021-07-12 16:56:40 -07:00
Batuhan Taskaya
1890dd235f
bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)
...
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-07-12 20:32:33 +01:00
David Sanders
da2e673c53
bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026)
2021-07-12 17:19:54 +02:00
Furkan Onder
66c5853406
bpo-26329: update os.path.normpath documentation (GH-20138)
...
* bpo-26329: update os.path.normpath documentation
* Update os.path.rst
* Update posixpath.py
* update Pathname Resolution note
2021-07-12 09:48:01 -03:00
dependabot[bot]
171d529a95
build(deps): bump actions/upload-artifact from 2.2.3 to 2.2.4 ( #26979 )
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.3...v2.2.4 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-12 13:29:13 +02:00
Mark Shannon
9487a17e3c
bpo-44207: Add an internal version number to function objects. (GH-27078)
2021-07-12 10:01:01 +01:00
Filipe Laíns
e14d5ae544
bpo-29753: revert 0d7ad9f
(GH-19850) (GH-27085)
...
This reverts commit 0d7ad9fb38
as it has a regression.
See https://github.com/python/cpython/pull/19850#issuecomment-869410686
2021-07-11 17:43:50 +01:00
andrei kulakov
248173cc04
bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049)
...
Fixes the misleading IsADirectoryError to be FileNotFoundError.
2021-07-09 20:47:41 -07:00
Pablo Galindo Salgado
f24777c2b3
bpo-44317: Improve tokenizer errors with more informative locations (GH-26555)
2021-07-10 01:29:29 +01:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)
7b21108445
Remove irrelevant comment which was added in 2a70a3a
(GH-27044)
2021-07-08 21:57:25 -07:00
Mark Shannon
da6414f0ac
bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068)
2021-07-08 19:21:09 +01:00
Filipe Laíns
91a8f8c16c
bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781)
...
As of 088a15c49d
, lineno is None instead
of -1 if there is no line number.
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-07-08 17:28:01 +01:00
Steve Dower
bbf2fb6c7a
bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059)
2021-07-08 16:48:42 +01:00
Ned Batchelder
af4a2dcc40
docs: add the word 'official' (GH-26849)
2021-07-08 09:58:13 -05:00
Mark Shannon
514f76bbac
bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064)
2021-07-08 13:33:13 +01:00
Erlend Egeberg Aasland
a3739b207a
bpo-43908: Immutable types inherit vectorcall (GH-27001)
...
Heap types with the Py_TPFLAGS_IMMUTABLETYPE flag can now inherit the
PEP 590 vectorcall protocol. Previously, this was only possible for static types.
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-07-08 12:48:01 +02:00
Julien Palard
15f0fc571c
Doc: Fix wrong exception used in example. (GH-26572)
2021-07-08 09:31:28 +02:00
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)
58248d9437
bpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263)
2021-07-08 16:16:08 +09:00
Ian Henriksen
fed2fc4443
bpo-43895: Remove an unnecessary cache of shared object handles (GH-25487)
...
* Remove an unnecessary cache of shared object handles.
2021-07-07 16:26:06 -07:00
Ammar Askar
052930f241
Remove __cleanenv from PEP-657 tests (GH-27060)
2021-07-07 22:47:50 +01:00
Ammar Askar
4823d9a512
bpo-43950: Add option to opt-out of PEP-657 (GH-27023)
...
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-07-07 20:07:12 +01:00