]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43680: _pyio.open() becomes a static method (GH-25354)
authorVictor Stinner <vstinner@python.org>
Mon, 12 Apr 2021 08:44:53 +0000 (10:44 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Apr 2021 08:44:53 +0000 (10:44 +0200)
commit77d668b1221d0f8c3e9d6b6199f67aaf3c45f040
tree9c1d155aebeed470a77c624ce7b5c5e6f80a5e90
parent9825bdfbd5c966abf1f1b7264992d722a94c9613
bpo-43680: _pyio.open() becomes a static method (GH-25354)

The Python _pyio.open() function becomes a static method to behave as
io.open() built-in function: don't become a bound method when stored
as a class variable. It becomes possible since static methods are now
callable in Python 3.10. Moreover, _pyio.OpenWrapper becomes a simple
alias to _pyio.open.

init_set_builtins_open() now sets builtins.open to io.open, rather
than setting it to io.OpenWrapper, since OpenWrapper is now an alias
to open in the io and _pyio modules.
Lib/_pyio.py
Misc/NEWS.d/next/Library/2021-04-12-09-57-37.bpo-43680.o1zEk_.rst [new file with mode: 0644]
Python/pylifecycle.c