Python-checkins
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
May 2019
- 1 participants
- 591 discussions
https://github.com/python/cpython/commit/c7f7069e77c58e83b847c0bfe4d5aadf6a…
commit: c7f7069e77c58e83b847c0bfe4d5aadf6add2e68
branch: master
author: Christian Heimes <christian(a)python.org>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T11:44:05+02:00
summary:
bpo-34271: Add ssl debugging helpers (GH-10031)
The ssl module now can dump key material to a keylog file and trace TLS
protocol messages with a tracing callback. The default and stdlib
contexts also support SSLKEYLOGFILE env var.
The msg_callback and related enums are private members. The feature
is designed for internal debugging and not for end users.
Signed-off-by: Christian Heimes <christian(a)python.org>
files:
A Misc/NEWS.d/next/Library/2018-10-21-17-39-32.bpo-34271.P15VLM.rst
A Modules/_ssl/debughelpers.c
M Doc/library/ssl.rst
M Lib/ssl.py
M Lib/test/test_ssl.py
M Modules/_ssl.c
M setup.py
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 20f572444716..be09f38f7dfa 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -139,6 +139,10 @@ purposes.
*cadata* is given) or uses :meth:`SSLContext.load_default_certs` to load
default CA certificates.
+ When :attr:`~SSLContext.keylog_filename` is supported and the environment
+ variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context`
+ enables key logging.
+
.. note::
The protocol, options, cipher and other settings may change to more
restrictive values anytime without prior deprecation. The values
@@ -172,6 +176,10 @@ purposes.
3DES was dropped from the default cipher string.
+ .. versionchanged:: 3.8
+
+ Support for key logging to :envvar:`SSLKEYLOGFILE` was added.
+
Exceptions
^^^^^^^^^^
@@ -1056,6 +1064,7 @@ Constants
SSL 3.0 to TLS 1.3.
+
SSL Sockets
-----------
@@ -1901,6 +1910,20 @@ to speed up repeated connections from the same clients.
This features requires OpenSSL 0.9.8f or newer.
+.. attribute:: SSLContext.keylog_filename
+
+ Write TLS keys to a keylog file, whenever key material is generated or
+ received. The keylog file is designed for debugging purposes only. The
+ file format is specified by NSS and used by many traffic analyzers such
+ as Wireshark. The log file is opened in append-only mode. Writes are
+ synchronized between threads, but not between processes.
+
+ .. versionadded:: 3.8
+
+ .. note::
+
+ This features requires OpenSSL 1.1.1 or newer.
+
.. attribute:: SSLContext.maximum_version
A :class:`TLSVersion` enum member representing the highest supported
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 793ed496c77a..f5fa6aeec2d2 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -165,6 +165,90 @@ class TLSVersion(_IntEnum):
MAXIMUM_SUPPORTED = _ssl.PROTO_MAXIMUM_SUPPORTED
+class _TLSContentType(_IntEnum):
+ """Content types (record layer)
+
+ See RFC 8446, section B.1
+ """
+ CHANGE_CIPHER_SPEC = 20
+ ALERT = 21
+ HANDSHAKE = 22
+ APPLICATION_DATA = 23
+ # pseudo content types
+ HEADER = 0x100
+ INNER_CONTENT_TYPE = 0x101
+
+
+class _TLSAlertType(_IntEnum):
+ """Alert types for TLSContentType.ALERT messages
+
+ See RFC 8466, section B.2
+ """
+ CLOSE_NOTIFY = 0
+ UNEXPECTED_MESSAGE = 10
+ BAD_RECORD_MAC = 20
+ DECRYPTION_FAILED = 21
+ RECORD_OVERFLOW = 22
+ DECOMPRESSION_FAILURE = 30
+ HANDSHAKE_FAILURE = 40
+ NO_CERTIFICATE = 41
+ BAD_CERTIFICATE = 42
+ UNSUPPORTED_CERTIFICATE = 43
+ CERTIFICATE_REVOKED = 44
+ CERTIFICATE_EXPIRED = 45
+ CERTIFICATE_UNKNOWN = 46
+ ILLEGAL_PARAMETER = 47
+ UNKNOWN_CA = 48
+ ACCESS_DENIED = 49
+ DECODE_ERROR = 50
+ DECRYPT_ERROR = 51
+ EXPORT_RESTRICTION = 60
+ PROTOCOL_VERSION = 70
+ INSUFFICIENT_SECURITY = 71
+ INTERNAL_ERROR = 80
+ INAPPROPRIATE_FALLBACK = 86
+ USER_CANCELED = 90
+ NO_RENEGOTIATION = 100
+ MISSING_EXTENSION = 109
+ UNSUPPORTED_EXTENSION = 110
+ CERTIFICATE_UNOBTAINABLE = 111
+ UNRECOGNIZED_NAME = 112
+ BAD_CERTIFICATE_STATUS_RESPONSE = 113
+ BAD_CERTIFICATE_HASH_VALUE = 114
+ UNKNOWN_PSK_IDENTITY = 115
+ CERTIFICATE_REQUIRED = 116
+ NO_APPLICATION_PROTOCOL = 120
+
+
+class _TLSMessageType(_IntEnum):
+ """Message types (handshake protocol)
+
+ See RFC 8446, section B.3
+ """
+ HELLO_REQUEST = 0
+ CLIENT_HELLO = 1
+ SERVER_HELLO = 2
+ HELLO_VERIFY_REQUEST = 3
+ NEWSESSION_TICKET = 4
+ END_OF_EARLY_DATA = 5
+ HELLO_RETRY_REQUEST = 6
+ ENCRYPTED_EXTENSIONS = 8
+ CERTIFICATE = 11
+ SERVER_KEY_EXCHANGE = 12
+ CERTIFICATE_REQUEST = 13
+ SERVER_DONE = 14
+ CERTIFICATE_VERIFY = 15
+ CLIENT_KEY_EXCHANGE = 16
+ FINISHED = 20
+ CERTIFICATE_URL = 21
+ CERTIFICATE_STATUS = 22
+ SUPPLEMENTAL_DATA = 23
+ KEY_UPDATE = 24
+ NEXT_PROTO = 67
+ MESSAGE_HASH = 254
+ CHANGE_CIPHER_SPEC = 0x0101
+
+
if sys.platform == "win32":
from _ssl import enum_certificates, enum_crls
@@ -523,6 +607,83 @@ def hostname_checks_common_name(self, value):
def hostname_checks_common_name(self):
return True
+ @property
+ def _msg_callback(self):
+ """TLS message callback
+
+ The message callback provides a debugging hook to analyze TLS
+ connections. The callback is called for any TLS protocol message
+ (header, handshake, alert, and more), but not for application data.
+ Due to technical limitations, the callback can't be used to filter
+ traffic or to abort a connection. Any exception raised in the
+ callback is delayed until the handshake, read, or write operation
+ has been performed.
+
+ def msg_cb(conn, direction, version, content_type, msg_type, data):
+ pass
+
+ conn
+ :class:`SSLSocket` or :class:`SSLObject` instance
+ direction
+ ``read`` or ``write``
+ version
+ :class:`TLSVersion` enum member or int for unknown version. For a
+ frame header, it's the header version.
+ content_type
+ :class:`_TLSContentType` enum member or int for unsupported
+ content type.
+ msg_type
+ Either a :class:`_TLSContentType` enum number for a header
+ message, a :class:`_TLSAlertType` enum member for an alert
+ message, a :class:`_TLSMessageType` enum member for other
+ messages, or int for unsupported message types.
+ data
+ Raw, decrypted message content as bytes
+ """
+ inner = super()._msg_callback
+ if inner is not None:
+ return inner.user_function
+ else:
+ return None
+
+ @_msg_callback.setter
+ def _msg_callback(self, callback):
+ if callback is None:
+ super(SSLContext, SSLContext)._msg_callback.__set__(self, None)
+ return
+
+ if not hasattr(callback, '__call__'):
+ raise TypeError(f"{callback} is not callable.")
+
+ def inner(conn, direction, version, content_type, msg_type, data):
+ try:
+ version = TLSVersion(version)
+ except TypeError:
+ pass
+
+ try:
+ content_type = _TLSContentType(content_type)
+ except TypeError:
+ pass
+
+ if content_type == _TLSContentType.HEADER:
+ msg_enum = _TLSContentType
+ elif content_type == _TLSContentType.ALERT:
+ msg_enum = _TLSAlertType
+ else:
+ msg_enum = _TLSMessageType
+ try:
+ msg_type = msg_enum(msg_type)
+ except TypeError:
+ pass
+
+ return callback(conn, direction, version,
+ content_type, msg_type, data)
+
+ inner.user_function = callback
+
+ super(SSLContext, SSLContext)._msg_callback.__set__(self, inner)
+
@property
def protocol(self):
return _SSLMethod(super().protocol)
@@ -576,6 +737,11 @@ def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
# CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
# root CA certificates for the given purpose. This may fail silently.
context.load_default_certs(purpose)
+ # OpenSSL 1.1.1 keylog file
+ if hasattr(context, 'keylog_filename'):
+ keylogfile = os.environ.get('SSLKEYLOGFILE')
+ if keylogfile and not sys.flags.ignore_environment:
+ context.keylog_filename = keylogfile
return context
def _create_unverified_context(protocol=PROTOCOL_TLS, *, cert_reqs=CERT_NONE,
@@ -617,7 +783,11 @@ def _create_unverified_context(protocol=PROTOCOL_TLS, *, cert_reqs=CERT_NONE,
# CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
# root CA certificates for the given purpose. This may fail silently.
context.load_default_certs(purpose)
-
+ # OpenSSL 1.1.1 keylog file
+ if hasattr(context, 'keylog_filename'):
+ keylogfile = os.environ.get('SSLKEYLOGFILE')
+ if keylogfile and not sys.flags.ignore_environment:
+ context.keylog_filename = keylogfile
return context
# Used by http.client if no context is explicitly passed.
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index d48d6e5569fc..f368906c8a94 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2,6 +2,7 @@
import sys
import unittest
+import unittest.mock
from test import support
import socket
import select
@@ -25,6 +26,7 @@
ssl = support.import_module("ssl")
+from ssl import TLSVersion, _TLSContentType, _TLSMessageType, _TLSAlertType
PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
HOST = support.HOST
@@ -4405,6 +4407,170 @@ def test_pha_not_tls13(self):
self.assertIn(b'WRONG_SSL_VERSION', s.recv(1024))
+HAS_KEYLOG = hasattr(ssl.SSLContext, 'keylog_filename')
+requires_keylog = unittest.skipUnless(
+ HAS_KEYLOG, 'test requires OpenSSL 1.1.1 with keylog callback')
+
+class TestSSLDebug(unittest.TestCase):
+
+ def keylog_lines(self, fname=support.TESTFN):
+ with open(fname) as f:
+ return len(list(f))
+
+ @requires_keylog
+ def test_keylog_defaults(self):
+ self.addCleanup(support.unlink, support.TESTFN)
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
+ self.assertEqual(ctx.keylog_filename, None)
+
+ self.assertFalse(os.path.isfile(support.TESTFN))
+ ctx.keylog_filename = support.TESTFN
+ self.assertEqual(ctx.keylog_filename, support.TESTFN)
+ self.assertTrue(os.path.isfile(support.TESTFN))
+ self.assertEqual(self.keylog_lines(), 1)
+
+ ctx.keylog_filename = None
+ self.assertEqual(ctx.keylog_filename, None)
+
+ with self.assertRaises((IsADirectoryError, PermissionError)):
+ # Windows raises PermissionError
+ ctx.keylog_filename = os.path.dirname(
+ os.path.abspath(support.TESTFN))
+
+ with self.assertRaises(TypeError):
+ ctx.keylog_filename = 1
+
+ @requires_keylog
+ def test_keylog_filename(self):
+ self.addCleanup(support.unlink, support.TESTFN)
+ client_context, server_context, hostname = testing_context()
+
+ client_context.keylog_filename = support.TESTFN
+ server = ThreadedEchoServer(context=server_context, chatty=False)
+ with server:
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+ # header, 5 lines for TLS 1.3
+ self.assertEqual(self.keylog_lines(), 6)
+
+ client_context.keylog_filename = None
+ server_context.keylog_filename = support.TESTFN
+ server = ThreadedEchoServer(context=server_context, chatty=False)
+ with server:
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+ self.assertGreaterEqual(self.keylog_lines(), 11)
+
+ client_context.keylog_filename = support.TESTFN
+ server_context.keylog_filename = support.TESTFN
+ server = ThreadedEchoServer(context=server_context, chatty=False)
+ with server:
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+ self.assertGreaterEqual(self.keylog_lines(), 21)
+
+ client_context.keylog_filename = None
+ server_context.keylog_filename = None
+
+ @requires_keylog
+ @unittest.skipIf(sys.flags.ignore_environment,
+ "test is not compatible with ignore_environment")
+ def test_keylog_env(self):
+ self.addCleanup(support.unlink, support.TESTFN)
+ with unittest.mock.patch.dict(os.environ):
+ os.environ['SSLKEYLOGFILE'] = support.TESTFN
+ self.assertEqual(os.environ['SSLKEYLOGFILE'], support.TESTFN)
+
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
+ self.assertEqual(ctx.keylog_filename, None)
+
+ ctx = ssl.create_default_context()
+ self.assertEqual(ctx.keylog_filename, support.TESTFN)
+
+ ctx = ssl._create_stdlib_context()
+ self.assertEqual(ctx.keylog_filename, support.TESTFN)
+
+ def test_msg_callback(self):
+ client_context, server_context, hostname = testing_context()
+
+ def msg_cb(conn, direction, version, content_type, msg_type, data):
+ pass
+
+ self.assertIs(client_context._msg_callback, None)
+ client_context._msg_callback = msg_cb
+ self.assertIs(client_context._msg_callback, msg_cb)
+ with self.assertRaises(TypeError):
+ client_context._msg_callback = object()
+
+ def test_msg_callback_tls12(self):
+ client_context, server_context, hostname = testing_context()
+ client_context.options |= ssl.OP_NO_TLSv1_3
+
+ msg = []
+
+ def msg_cb(conn, direction, version, content_type, msg_type, data):
+ self.assertIsInstance(conn, ssl.SSLSocket)
+ self.assertIsInstance(data, bytes)
+ self.assertIn(direction, {'read', 'write'})
+ msg.append((direction, version, content_type, msg_type))
+
+ client_context._msg_callback = msg_cb
+
+ server = ThreadedEchoServer(context=server_context, chatty=False)
+ with server:
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+
+ self.assertEqual(msg, [
+ ("write", TLSVersion.TLSv1, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.CLIENT_HELLO),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.SERVER_HELLO),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.CERTIFICATE),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.SERVER_KEY_EXCHANGE),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.SERVER_DONE),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.CLIENT_KEY_EXCHANGE),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.FINISHED),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.CHANGE_CIPHER_SPEC,
+ _TLSMessageType.CHANGE_CIPHER_SPEC),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("write", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.FINISHED),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.NEWSESSION_TICKET),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.FINISHED),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HEADER,
+ _TLSMessageType.CERTIFICATE_STATUS),
+ ("read", TLSVersion.TLSv1_2, _TLSContentType.HANDSHAKE,
+ _TLSMessageType.FINISHED),
+ ])
+
+
def test_main(verbose=False):
if support.verbose:
import warnings
@@ -4440,7 +4606,7 @@ def test_main(verbose=False):
tests = [
ContextTests, BasicSocketTests, SSLErrorTests, MemoryBIOTests,
SSLObjectTests, SimpleBackgroundTests, ThreadedTests,
- TestPostHandshakeAuth
+ TestPostHandshakeAuth, TestSSLDebug
]
if support.is_resource_enabled('network'):
diff --git a/Misc/NEWS.d/next/Library/2018-10-21-17-39-32.bpo-34271.P15VLM.rst b/Misc/NEWS.d/next/Library/2018-10-21-17-39-32.bpo-34271.P15VLM.rst
new file mode 100644
index 000000000000..344388f7f228
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-10-21-17-39-32.bpo-34271.P15VLM.rst
@@ -0,0 +1,3 @@
+Add debugging helpers to ssl module. It's now possible to dump key material
+and to trace TLS protocol. The default and stdlib contexts also support
+SSLKEYLOGFILE env var.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 4fb7dca9bb04..f40127d3d932 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -185,6 +185,10 @@ static void _PySSLFixErrno(void) {
# define HAVE_NPN 0
#endif
+#if (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
+#define HAVE_OPENSSL_KEYLOG 1
+#endif
+
#ifndef INVALID_SOCKET /* MS defines this */
#define INVALID_SOCKET (-1)
#endif
@@ -423,6 +427,11 @@ typedef struct {
int protocol;
#ifdef TLS1_3_VERSION
int post_handshake_auth;
+#endif
+ PyObject *msg_cb;
+#ifdef HAVE_OPENSSL_KEYLOG
+ PyObject *keylog_filename;
+ BIO *keylog_bio;
#endif
} PySSLContext;
@@ -444,6 +453,13 @@ typedef struct {
PyObject *owner; /* Python level "owner" passed to servername callback */
PyObject *server_hostname;
_PySSLError err; /* last seen error from various sources */
+ /* Some SSL callbacks don't have error reporting. Callback wrappers
+ * store exception information on the socket. The handshake, read, write,
+ * and shutdown methods check for chained exceptions.
+ */
+ PyObject *exc_type;
+ PyObject *exc_value;
+ PyObject *exc_tb;
} PySSLSocket;
typedef struct {
@@ -517,6 +533,8 @@ typedef enum {
#define GET_SOCKET_TIMEOUT(sock) \
((sock != NULL) ? (sock)->sock_timeout : 0)
+#include "_ssl/debughelpers.c"
+
/*
* SSL errors.
*/
@@ -703,6 +721,18 @@ fill_and_set_sslerror(PySSLSocket *sslsock, PyObject *type, int ssl_errno,
Py_XDECREF(verify_obj);
}
+static int
+PySSL_ChainExceptions(PySSLSocket *sslsock) {
+ if (sslsock->exc_type == NULL)
+ return 0;
+
+ _PyErr_ChainExceptions(sslsock->exc_type, sslsock->exc_value, sslsock->exc_tb);
+ sslsock->exc_type = NULL;
+ sslsock->exc_value = NULL;
+ sslsock->exc_tb = NULL;
+ return -1;
+}
+
static PyObject *
PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno)
{
@@ -796,6 +826,7 @@ PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno)
}
fill_and_set_sslerror(sslsock, type, p, errstr, lineno, e);
ERR_clear_error();
+ PySSL_ChainExceptions(sslsock);
return NULL;
}
@@ -903,6 +934,9 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
self->owner = NULL;
self->server_hostname = NULL;
self->err = err;
+ self->exc_type = NULL;
+ self->exc_value = NULL;
+ self->exc_tb = NULL;
/* Make sure the SSL error state is initialized */
ERR_clear_error();
@@ -1052,11 +1086,12 @@ _ssl__SSLSocket_do_handshake_impl(PySSLSocket *self)
Py_XDECREF(sock);
if (ret < 1)
return PySSL_SetError(self, ret, __FILE__, __LINE__);
-
+ if (PySSL_ChainExceptions(self) < 0)
+ return NULL;
Py_RETURN_NONE;
-
error:
Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
return NULL;
}
@@ -2151,8 +2186,26 @@ PyDoc_STRVAR(PySSL_get_owner_doc,
"The Python-level owner of this object.\
Passed as \"self\" in servername callback.");
+static int
+PySSL_traverse(PySSLSocket *self, visitproc visit, void *arg)
+{
+ Py_VISIT(self->exc_type);
+ Py_VISIT(self->exc_value);
+ Py_VISIT(self->exc_tb);
+ return 0;
+}
+
+static int
+PySSL_clear(PySSLSocket *self)
+{
+ Py_CLEAR(self->exc_type);
+ Py_CLEAR(self->exc_value);
+ Py_CLEAR(self->exc_tb);
+ return 0;
+}
-static void PySSL_dealloc(PySSLSocket *self)
+static void
+PySSL_dealloc(PySSLSocket *self)
{
if (self->ssl)
SSL_free(self->ssl);
@@ -2333,13 +2386,14 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)
err.ssl == SSL_ERROR_WANT_WRITE);
Py_XDECREF(sock);
- if (len > 0)
- return PyLong_FromLong(len);
- else
+ if (len <= 0)
return PySSL_SetError(self, len, __FILE__, __LINE__);
-
+ if (PySSL_ChainExceptions(self) < 0)
+ return NULL;
+ return PyLong_FromLong(len);
error:
Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
return NULL;
}
@@ -2486,6 +2540,8 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
PySSL_SetError(self, count, __FILE__, __LINE__);
goto error;
}
+ if (self->exc_type != NULL)
+ goto error;
done:
Py_XDECREF(sock);
@@ -2498,6 +2554,7 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
}
error:
+ PySSL_ChainExceptions(self);
Py_XDECREF(sock);
if (!group_right_1)
Py_XDECREF(dest);
@@ -2601,11 +2658,13 @@ _ssl__SSLSocket_shutdown_impl(PySSLSocket *self)
/* Retain the SSL error code */
break;
}
-
if (ret < 0) {
Py_XDECREF(sock);
- return PySSL_SetError(self, ret, __FILE__, __LINE__);
+ PySSL_SetError(self, ret, __FILE__, __LINE__);
+ return NULL;
}
+ if (self->exc_type != NULL)
+ goto error;
if (sock)
/* It's already INCREF'ed */
return (PyObject *) sock;
@@ -2614,6 +2673,7 @@ _ssl__SSLSocket_shutdown_impl(PySSLSocket *self)
error:
Py_XDECREF(sock);
+ PySSL_ChainExceptions(self);
return NULL;
}
@@ -2889,8 +2949,8 @@ static PyTypeObject PySSLSocket_Type = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT, /*tp_flags*/
0, /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
+ (traverseproc) PySSL_traverse, /*tp_traverse*/
+ (inquiry) PySSL_clear, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -3002,6 +3062,11 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
self->ctx = ctx;
self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
self->protocol = proto_version;
+ self->msg_cb = NULL;
+#ifdef HAVE_OPENSSL_KEYLOG
+ self->keylog_filename = NULL;
+ self->keylog_bio = NULL;
+#endif
#if HAVE_NPN
self->npn_protocols = NULL;
#endif
@@ -3127,6 +3192,7 @@ context_traverse(PySSLContext *self, visitproc visit, void *arg)
#ifndef OPENSSL_NO_TLSEXT
Py_VISIT(self->set_sni_cb);
#endif
+ Py_VISIT(self->msg_cb);
return 0;
}
@@ -3135,6 +3201,16 @@ context_clear(PySSLContext *self)
{
#ifndef OPENSSL_NO_TLSEXT
Py_CLEAR(self->set_sni_cb);
+#endif
+ Py_CLEAR(self->msg_cb);
+#ifdef HAVE_OPENSSL_KEYLOG
+ Py_CLEAR(self->keylog_filename);
+ if (self->keylog_bio != NULL) {
+ PySSL_BEGIN_ALLOW_THREADS
+ BIO_free_all(self->keylog_bio);
+ PySSL_END_ALLOW_THREADS
+ self->keylog_bio = NULL;
+ }
#endif
return 0;
}
@@ -4570,6 +4646,12 @@ static PyGetSetDef context_getsetlist[] = {
{"maximum_version", (getter) get_maximum_version,
(setter) set_maximum_version, NULL},
#endif
+#ifdef HAVE_OPENSSL_KEYLOG
+ {"keylog_filename", (getter) _PySSLContext_get_keylog_filename,
+ (setter) _PySSLContext_set_keylog_filename, NULL},
+#endif
+ {"_msg_callback", (getter) _PySSLContext_get_msg_callback,
+ (setter) _PySSLContext_set_msg_callback, NULL},
{"sni_callback", (getter) get_sni_callback,
(setter) set_sni_callback, PySSLContext_sni_callback_doc},
{"options", (getter) get_options,
diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c
new file mode 100644
index 000000000000..53b966749328
--- /dev/null
+++ b/Modules/_ssl/debughelpers.c
@@ -0,0 +1,213 @@
+/* Debug helpers */
+
+static void
+_PySSL_msg_callback(int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg)
+{
+ const char *cbuf = (const char *)buf;
+ PyGILState_STATE threadstate;
+ PyObject *res = NULL;
+ PySSLSocket *ssl_obj = NULL; /* ssl._SSLSocket, borrowed ref */
+ PyObject *ssl_socket = NULL; /* ssl.SSLSocket or ssl.SSLObject */
+ int msg_type;
+
+ threadstate = PyGILState_Ensure();
+
+ ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl);
+ assert(PySSLSocket_Check(ssl_obj));
+ if (ssl_obj->ctx->msg_cb == NULL) {
+ return;
+ }
+
+ if (ssl_obj->owner)
+ ssl_socket = PyWeakref_GetObject(ssl_obj->owner);
+ else if (ssl_obj->Socket)
+ ssl_socket = PyWeakref_GetObject(ssl_obj->Socket);
+ else
+ ssl_socket = (PyObject *)ssl_obj;
+ Py_INCREF(ssl_socket);
+
+ /* assume that OpenSSL verifies all payload and buf len is of sufficient
+ length */
+ switch(content_type) {
+ case SSL3_RT_CHANGE_CIPHER_SPEC:
+ msg_type = SSL3_MT_CHANGE_CIPHER_SPEC;
+ break;
+ case SSL3_RT_ALERT:
+ /* byte 0: level */
+ /* byte 1: alert type */
+ msg_type = (int)cbuf[1];
+ break;
+ case SSL3_RT_HANDSHAKE:
+ msg_type = (int)cbuf[0];
+ break;
+ case SSL3_RT_HEADER:
+ /* frame header encodes version in bytes 1..2 */
+ version = cbuf[1] << 8 | cbuf[2];
+ msg_type = (int)cbuf[0];
+ break;
+#ifdef SSL3_RT_INNER_CONTENT_TYPE
+ case SSL3_RT_INNER_CONTENT_TYPE:
+ msg_type = (int)cbuf[0];
+ break;
+#endif
+ default:
+ /* never SSL3_RT_APPLICATION_DATA */
+ msg_type = -1;
+ break;
+ }
+
+ res = PyObject_CallFunction(
+ ssl_obj->ctx->msg_cb, "Osiiiy#",
+ ssl_socket, write_p ? "write" : "read",
+ version, content_type, msg_type,
+ buf, len
+ );
+ if (res == NULL) {
+ PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb);
+ } else {
+ Py_DECREF(res);
+ }
+ Py_XDECREF(ssl_socket);
+
+ PyGILState_Release(threadstate);
+}
+
+
+static PyObject *
+_PySSLContext_get_msg_callback(PySSLContext *self, void *c) {
+ if (self->msg_cb != NULL) {
+ Py_INCREF(self->msg_cb);
+ return self->msg_cb;
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+_PySSLContext_set_msg_callback(PySSLContext *self, PyObject *arg, void *c) {
+ Py_CLEAR(self->msg_cb);
+ if (arg == Py_None) {
+ SSL_CTX_set_msg_callback(self->ctx, NULL);
+ }
+ else {
+ if (!PyCallable_Check(arg)) {
+ SSL_CTX_set_msg_callback(self->ctx, NULL);
+ PyErr_SetString(PyExc_TypeError,
+ "not a callable object");
+ return -1;
+ }
+ Py_INCREF(arg);
+ self->msg_cb = arg;
+ SSL_CTX_set_msg_callback(self->ctx, _PySSL_msg_callback);
+ }
+ return 0;
+}
+
+#ifdef HAVE_OPENSSL_KEYLOG
+
+static void
+_PySSL_keylog_callback(const SSL *ssl, const char *line)
+{
+ PyGILState_STATE threadstate;
+ PySSLSocket *ssl_obj = NULL; /* ssl._SSLSocket, borrowed ref */
+ int res, e;
+ static PyThread_type_lock *lock = NULL;
+
+ threadstate = PyGILState_Ensure();
+
+ /* Allocate a static lock to synchronize writes to keylog file.
+ * The lock is neither released on exit nor on fork(). The lock is
+ * also shared between all SSLContexts although contexts may write to
+ * their own files. IMHO that's good enough for a non-performance
+ * critical debug helper.
+ */
+ if (lock == NULL) {
+ lock = PyThread_allocate_lock();
+ if (lock == NULL) {
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
+ PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value,
+ &ssl_obj->exc_tb);
+ return;
+ }
+ }
+
+ ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl);
+ assert(PySSLSocket_Check(ssl_obj));
+ if (ssl_obj->ctx->keylog_bio == NULL) {
+ return;
+ }
+
+ PySSL_BEGIN_ALLOW_THREADS
+ PyThread_acquire_lock(lock, 1);
+ res = BIO_printf(ssl_obj->ctx->keylog_bio, "%s\n", line);
+ e = errno;
+ (void)BIO_flush(ssl_obj->ctx->keylog_bio);
+ PyThread_release_lock(lock);
+ PySSL_END_ALLOW_THREADS
+
+ if (res == -1) {
+ errno = e;
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
+ ssl_obj->ctx->keylog_filename);
+ PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb);
+ }
+ PyGILState_Release(threadstate);
+}
+
+static PyObject *
+_PySSLContext_get_keylog_filename(PySSLContext *self, void *c) {
+ if (self->keylog_filename != NULL) {
+ Py_INCREF(self->keylog_filename);
+ return self->keylog_filename;
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
+static int
+_PySSLContext_set_keylog_filename(PySSLContext *self, PyObject *arg, void *c) {
+ FILE *fp;
+ /* Reset variables and callback first */
+ SSL_CTX_set_keylog_callback(self->ctx, NULL);
+ Py_CLEAR(self->keylog_filename);
+ if (self->keylog_bio != NULL) {
+ BIO *bio = self->keylog_bio;
+ self->keylog_bio = NULL;
+ PySSL_BEGIN_ALLOW_THREADS
+ BIO_free_all(bio);
+ PySSL_END_ALLOW_THREADS
+ }
+
+ if (arg == Py_None) {
+ /* None disables the callback */
+ return 0;
+ }
+
+ /* _Py_fopen_obj() also checks that arg is of proper type. */
+ fp = _Py_fopen_obj(arg, "a" PY_STDIOTEXTMODE);
+ if (fp == NULL)
+ return -1;
+
+ self->keylog_bio = BIO_new_fp(fp, BIO_CLOSE | BIO_FP_TEXT);
+ if (self->keylog_bio == NULL) {
+ PyErr_SetString(PySSLErrorObject,
+ "Can't malloc memory for keylog file");
+ return -1;
+ }
+ Py_INCREF(arg);
+ self->keylog_filename = arg;
+
+ /* Write a header for seekable, empty files (this excludes pipes). */
+ PySSL_BEGIN_ALLOW_THREADS
+ if (BIO_tell(self->keylog_bio) == 0) {
+ BIO_puts(self->keylog_bio,
+ "# TLS secrets log file, generated by OpenSSL / Python\n");
+ (void)BIO_flush(self->keylog_bio);
+ }
+ PySSL_END_ALLOW_THREADS
+ SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback);
+ return 0;
+}
+
+#endif
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 96a49b4e353c..7852c2dfa27e 100644
--- a/setup.py
+++ b/setup.py
@@ -2178,11 +2178,13 @@ def split_var(name, sep):
ssl_incs.extend(krb5_h)
if config_vars.get("HAVE_X509_VERIFY_PARAM_SET1_HOST"):
- self.add(Extension('_ssl', ['_ssl.c'],
- include_dirs=openssl_includes,
- library_dirs=openssl_libdirs,
- libraries=openssl_libs,
- depends=['socketmodule.h']))
+ self.add(Extension(
+ '_ssl', ['_ssl.c'],
+ include_dirs=openssl_includes,
+ library_dirs=openssl_libdirs,
+ libraries=openssl_libs,
+ depends=['socketmodule.h', '_ssl/debughelpers.c'])
+ )
else:
self.missing.append('_ssl')
1
0

IDLE - Capitalize search dialogs' 'Close' button label. (GH-13691)
by Miss Islington (bot) May 31, 2019
by Miss Islington (bot) May 31, 2019
May 31, 2019
https://github.com/python/cpython/commit/ee114d7795d3490a98d9a788dc11e6da22…
commit: ee114d7795d3490a98d9a788dc11e6da221b0b9f
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T01:44:29-07:00
summary:
IDLE - Capitalize search dialogs' 'Close' button label. (GH-13691)
It seems to be the only widget label not capitalized.
(cherry picked from commit ba0430211f5101c9d748d72b03926ca79c5252a8)
Co-authored-by: Terry Jan Reedy <tjreedy(a)udel.edu>
files:
M Lib/idlelib/idle_test/test_searchbase.py
M Lib/idlelib/searchbase.py
diff --git a/Lib/idlelib/idle_test/test_searchbase.py b/Lib/idlelib/idle_test/test_searchbase.py
index 09a7fff51de1..6dd4d7933737 100644
--- a/Lib/idlelib/idle_test/test_searchbase.py
+++ b/Lib/idlelib/idle_test/test_searchbase.py
@@ -32,6 +32,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ cls.root.update_idletasks()
cls.root.destroy()
del cls.root
@@ -149,7 +150,7 @@ def test_create_command_buttons(self):
# Look for close button command in buttonframe
closebuttoncommand = ''
for child in self.dialog.buttonframe.winfo_children():
- if child['text'] == 'close':
+ if child['text'] == 'Close':
closebuttoncommand = child['command']
self.assertIn('close', closebuttoncommand)
diff --git a/Lib/idlelib/searchbase.py b/Lib/idlelib/searchbase.py
index f0e3d6f14ba4..74ba8538512b 100644
--- a/Lib/idlelib/searchbase.py
+++ b/Lib/idlelib/searchbase.py
@@ -172,7 +172,7 @@ def create_command_buttons(self):
f = self.buttonframe = Frame(self.top)
f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2)
- b = self.make_button("close", self.close)
+ b = self.make_button("Close", self.close)
b.lower()
1
0

bpo-26660, bpo-35144: Fix permission errors in TemporaryDirectory cleanup. (GH-10320)
by Serhiy Storchaka May 31, 2019
by Serhiy Storchaka May 31, 2019
May 31, 2019
https://github.com/python/cpython/commit/e9b51c0ad81da1da11ae65840ac8b50a85…
commit: e9b51c0ad81da1da11ae65840ac8b50a8521373c
branch: master
author: Serhiy Storchaka <storchaka(a)gmail.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T11:30:37+03:00
summary:
bpo-26660, bpo-35144: Fix permission errors in TemporaryDirectory cleanup. (GH-10320)
TemporaryDirectory.cleanup() failed when non-writeable or non-searchable
files or directories were created inside a temporary directory.
files:
A Misc/NEWS.d/next/Library/2018-11-04-16-39-46.bpo-26660.RdXz8a.rst
M Lib/shutil.py
M Lib/tempfile.py
M Lib/test/test_tempfile.py
diff --git a/Lib/shutil.py b/Lib/shutil.py
index dae916b41605..6486cd6e5d28 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -584,11 +584,16 @@ def _rmtree_safe_fd(topfd, path, onerror):
fullname = os.path.join(path, entry.name)
try:
is_dir = entry.is_dir(follow_symlinks=False)
- if is_dir:
- orig_st = entry.stat(follow_symlinks=False)
- is_dir = stat.S_ISDIR(orig_st.st_mode)
except OSError:
is_dir = False
+ else:
+ if is_dir:
+ try:
+ orig_st = entry.stat(follow_symlinks=False)
+ is_dir = stat.S_ISDIR(orig_st.st_mode)
+ except OSError:
+ onerror(os.lstat, fullname, sys.exc_info())
+ continue
if is_dir:
try:
dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index a66d6f3750cb..e8b111eae223 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -777,9 +777,39 @@ def __init__(self, suffix=None, prefix=None, dir=None):
self, self._cleanup, self.name,
warn_message="Implicitly cleaning up {!r}".format(self))
+ @classmethod
+ def _rmtree(cls, name):
+ def onerror(func, path, exc_info):
+ if issubclass(exc_info[0], PermissionError):
+ def resetperms(path):
+ try:
+ _os.chflags(path, 0)
+ except AttributeError:
+ pass
+ _os.chmod(path, 0o700)
+
+ try:
+ if path != name:
+ resetperms(_os.path.dirname(path))
+ resetperms(path)
+
+ try:
+ _os.unlink(path)
+ # PermissionError is raised on FreeBSD for directories
+ except (IsADirectoryError, PermissionError):
+ cls._rmtree(path)
+ except FileNotFoundError:
+ pass
+ elif issubclass(exc_info[0], FileNotFoundError):
+ pass
+ else:
+ raise
+
+ _shutil.rmtree(name, onerror=onerror)
+
@classmethod
def _cleanup(cls, name, warn_message):
- _shutil.rmtree(name)
+ cls._rmtree(name)
_warnings.warn(warn_message, ResourceWarning)
def __repr__(self):
@@ -793,4 +823,4 @@ def __exit__(self, exc, value, tb):
def cleanup(self):
if self._finalizer.detach():
- _shutil.rmtree(self.name)
+ self._rmtree(self.name)
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 489141d6ad72..bd4db839331b 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -1297,19 +1297,25 @@ def __exit__(self, *exc_info):
class TestTemporaryDirectory(BaseTestCase):
"""Test TemporaryDirectory()."""
- def do_create(self, dir=None, pre="", suf="", recurse=1):
+ def do_create(self, dir=None, pre="", suf="", recurse=1, dirs=1, files=1):
if dir is None:
dir = tempfile.gettempdir()
tmp = tempfile.TemporaryDirectory(dir=dir, prefix=pre, suffix=suf)
self.nameCheck(tmp.name, dir, pre, suf)
- # Create a subdirectory and some files
- if recurse:
- d1 = self.do_create(tmp.name, pre, suf, recurse-1)
- d1.name = None
- with open(os.path.join(tmp.name, "test.txt"), "wb") as f:
- f.write(b"Hello world!")
+ self.do_create2(tmp.name, recurse, dirs, files)
return tmp
+ def do_create2(self, path, recurse=1, dirs=1, files=1):
+ # Create subdirectories and some files
+ if recurse:
+ for i in range(dirs):
+ name = os.path.join(path, "dir%d" % i)
+ os.mkdir(name)
+ self.do_create2(name, recurse-1, dirs, files)
+ for i in range(files):
+ with open(os.path.join(path, "test%d.txt" % i), "wb") as f:
+ f.write(b"Hello world!")
+
def test_mkdtemp_failure(self):
# Check no additional exception if mkdtemp fails
# Previously would raise AttributeError instead
@@ -1349,7 +1355,7 @@ def test_cleanup_with_symlink_to_a_directory(self):
"TemporaryDirectory %s exists after cleanup" % d1.name)
self.assertTrue(os.path.exists(d2.name),
"Directory pointed to by a symlink was deleted")
- self.assertEqual(os.listdir(d2.name), ['test.txt'],
+ self.assertEqual(os.listdir(d2.name), ['test0.txt'],
"Contents of the directory pointed to by a symlink "
"were deleted")
d2.cleanup()
@@ -1384,7 +1390,7 @@ def test_del_on_shutdown(self):
tmp2 = os.path.join(tmp.name, 'test_dir')
os.mkdir(tmp2)
- with open(os.path.join(tmp2, "test.txt"), "w") as f:
+ with open(os.path.join(tmp2, "test0.txt"), "w") as f:
f.write("Hello world!")
{mod}.tmp = tmp
@@ -1452,6 +1458,33 @@ def test_context_manager(self):
self.assertEqual(name, d.name)
self.assertFalse(os.path.exists(name))
+ def test_modes(self):
+ for mode in range(8):
+ mode <<= 6
+ with self.subTest(mode=format(mode, '03o')):
+ d = self.do_create(recurse=3, dirs=2, files=2)
+ with d:
+ # Change files and directories mode recursively.
+ for root, dirs, files in os.walk(d.name, topdown=False):
+ for name in files:
+ os.chmod(os.path.join(root, name), mode)
+ os.chmod(root, mode)
+ d.cleanup()
+ self.assertFalse(os.path.exists(d.name))
+
+ @unittest.skipUnless(hasattr(os, 'chflags'), 'requires os.lchflags')
+ def test_flags(self):
+ flags = stat.UF_IMMUTABLE | stat.UF_NOUNLINK
+ d = self.do_create(recurse=3, dirs=2, files=2)
+ with d:
+ # Change files and directories flags recursively.
+ for root, dirs, files in os.walk(d.name, topdown=False):
+ for name in files:
+ os.chflags(os.path.join(root, name), flags)
+ os.chflags(root, flags)
+ d.cleanup()
+ self.assertFalse(os.path.exists(d.name))
+
if __name__ == "__main__":
unittest.main()
diff --git a/Misc/NEWS.d/next/Library/2018-11-04-16-39-46.bpo-26660.RdXz8a.rst b/Misc/NEWS.d/next/Library/2018-11-04-16-39-46.bpo-26660.RdXz8a.rst
new file mode 100644
index 000000000000..4448bf6b0164
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-11-04-16-39-46.bpo-26660.RdXz8a.rst
@@ -0,0 +1,4 @@
+Fixed permission errors in :class:`~tempfile.TemporaryDirectory` clean up.
+Previously ``TemporaryDirectory.cleanup()`` failed when non-writeable or
+non-searchable files or directories were created inside a temporary
+directory.
1
0

bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. (GH-11859)
by Serhiy Storchaka May 31, 2019
by Serhiy Storchaka May 31, 2019
May 31, 2019
https://github.com/python/cpython/commit/38ab7d4721b422547f7b46b9d68968863f…
commit: 38ab7d4721b422547f7b46b9d68968863fa70573
branch: master
author: Serhiy Storchaka <storchaka(a)gmail.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T11:29:39+03:00
summary:
bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. (GH-11859)
Escape ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) in Unicode strings.
files:
A Misc/NEWS.d/next/Library/2017-10-21-12-07-56.bpo-31829.6IhP-O.rst
M Lib/pickle.py
M Lib/test/pickletester.py
M Modules/_pickle.c
diff --git a/Lib/pickle.py b/Lib/pickle.py
index cb768b28586a..a67ac7dd8b68 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -852,7 +852,10 @@ def save_str(self, obj):
self.write(BINUNICODE + pack("<I", n) + encoded)
else:
obj = obj.replace("\\", "\\u005c")
+ obj = obj.replace("\0", "\\u0000")
obj = obj.replace("\n", "\\u000a")
+ obj = obj.replace("\r", "\\u000d")
+ obj = obj.replace("\x1a", "\\u001a") # EOF on DOS
self.write(UNICODE + obj.encode('raw-unicode-escape') +
b'\n')
self.memoize(obj)
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index f6fda9ee6d83..f8f3bc92e7fe 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -3067,22 +3067,20 @@ def __getattr__(self, key):
class AbstractPickleModuleTests(unittest.TestCase):
def test_dump_closed_file(self):
- import os
f = open(TESTFN, "wb")
try:
f.close()
self.assertRaises(ValueError, self.dump, 123, f)
finally:
- os.remove(TESTFN)
+ support.unlink(TESTFN)
def test_load_closed_file(self):
- import os
f = open(TESTFN, "wb")
try:
f.close()
self.assertRaises(ValueError, self.dump, 123, f)
finally:
- os.remove(TESTFN)
+ support.unlink(TESTFN)
def test_load_from_and_dump_to_file(self):
stream = io.BytesIO()
@@ -3106,6 +3104,19 @@ def test_callapi(self):
self.Pickler(f, -1)
self.Pickler(f, protocol=-1)
+ def test_dump_text_file(self):
+ f = open(TESTFN, "w")
+ try:
+ for proto in protocols:
+ self.assertRaises(TypeError, self.dump, 123, f, proto)
+ finally:
+ f.close()
+ support.unlink(TESTFN)
+
+ def test_incomplete_input(self):
+ s = io.BytesIO(b"X''.")
+ self.assertRaises((EOFError, struct.error, pickle.UnpicklingError), self.load, s)
+
def test_bad_init(self):
# Test issue3664 (pickle can segfault from a badly initialized Pickler).
# Override initialization without calling __init__() of the superclass.
diff --git a/Misc/NEWS.d/next/Library/2017-10-21-12-07-56.bpo-31829.6IhP-O.rst b/Misc/NEWS.d/next/Library/2017-10-21-12-07-56.bpo-31829.6IhP-O.rst
new file mode 100644
index 000000000000..aefb8aec16fd
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-10-21-12-07-56.bpo-31829.6IhP-O.rst
@@ -0,0 +1,3 @@
+``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) are now escaped in
+protocol 0 pickles of Unicode strings. This allows to load them without loss
+from files open in text mode in Python 2.
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 57145beb8fff..34e11bd5f820 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -2588,7 +2588,10 @@ raw_unicode_escape(PyObject *obj)
*p++ = Py_hexdigits[ch & 15];
}
/* Map 16-bit characters, '\\' and '\n' to '\uxxxx' */
- else if (ch >= 256 || ch == '\\' || ch == '\n') {
+ else if (ch >= 256 ||
+ ch == '\\' || ch == 0 || ch == '\n' || ch == '\r' ||
+ ch == 0x1a)
+ {
/* -1: subtract 1 preallocated byte */
p = _PyBytesWriter_Prepare(&writer, p, 6-1);
if (p == NULL)
1
0

May 31, 2019
https://github.com/python/cpython/commit/ba0430211f5101c9d748d72b03926ca79c…
commit: ba0430211f5101c9d748d72b03926ca79c5252a8
branch: master
author: Terry Jan Reedy <tjreedy(a)udel.edu>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T04:26:35-04:00
summary:
IDLE - Capitalize search dialogs' 'Close' button label. (#13691)
It seems to be the only widget label not capitalized.
files:
M Lib/idlelib/idle_test/test_searchbase.py
M Lib/idlelib/searchbase.py
diff --git a/Lib/idlelib/idle_test/test_searchbase.py b/Lib/idlelib/idle_test/test_searchbase.py
index 09a7fff51de1..6dd4d7933737 100644
--- a/Lib/idlelib/idle_test/test_searchbase.py
+++ b/Lib/idlelib/idle_test/test_searchbase.py
@@ -32,6 +32,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
+ cls.root.update_idletasks()
cls.root.destroy()
del cls.root
@@ -149,7 +150,7 @@ def test_create_command_buttons(self):
# Look for close button command in buttonframe
closebuttoncommand = ''
for child in self.dialog.buttonframe.winfo_children():
- if child['text'] == 'close':
+ if child['text'] == 'Close':
closebuttoncommand = child['command']
self.assertIn('close', closebuttoncommand)
diff --git a/Lib/idlelib/searchbase.py b/Lib/idlelib/searchbase.py
index f0e3d6f14ba4..74ba8538512b 100644
--- a/Lib/idlelib/searchbase.py
+++ b/Lib/idlelib/searchbase.py
@@ -172,7 +172,7 @@ def create_command_buttons(self):
f = self.buttonframe = Frame(self.top)
f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2)
- b = self.make_button("close", self.close)
+ b = self.make_button("Close", self.close)
b.lower()
1
0
https://github.com/python/cpython/commit/14a0e16c8805f7ba7c98132ead815dcfdf…
commit: 14a0e16c8805f7ba7c98132ead815dcfdf0e9d33
branch: master
author: Serhiy Storchaka <storchaka(a)gmail.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T10:39:47+03:00
summary:
bpo-36548: Improve the repr of re flags. (GH-12715)
files:
A Misc/NEWS.d/next/Library/2019-04-07-14-30-10.bpo-36548.CJQiYw.rst
M Lib/re.py
M Lib/test/test_re.py
diff --git a/Lib/re.py b/Lib/re.py
index 68d62dc2a93b..8f1d55ddf7d6 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -141,24 +141,40 @@
__version__ = "2.2.1"
class RegexFlag(enum.IntFlag):
- ASCII = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
- IGNORECASE = sre_compile.SRE_FLAG_IGNORECASE # ignore case
- LOCALE = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
- UNICODE = sre_compile.SRE_FLAG_UNICODE # assume unicode "locale"
- MULTILINE = sre_compile.SRE_FLAG_MULTILINE # make anchors look for newline
- DOTALL = sre_compile.SRE_FLAG_DOTALL # make dot match newline
- VERBOSE = sre_compile.SRE_FLAG_VERBOSE # ignore whitespace and comments
- A = ASCII
- I = IGNORECASE
- L = LOCALE
- U = UNICODE
- M = MULTILINE
- S = DOTALL
- X = VERBOSE
+ ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
+ IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case
+ LOCALE = L = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
+ UNICODE = U = sre_compile.SRE_FLAG_UNICODE # assume unicode "locale"
+ MULTILINE = M = sre_compile.SRE_FLAG_MULTILINE # make anchors look for newline
+ DOTALL = S = sre_compile.SRE_FLAG_DOTALL # make dot match newline
+ VERBOSE = X = sre_compile.SRE_FLAG_VERBOSE # ignore whitespace and comments
# sre extensions (experimental, don't rely on these)
- TEMPLATE = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
- T = TEMPLATE
+ TEMPLATE = T = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation
+
+ def __repr__(self):
+ if self._name_ is not None:
+ return f're.{self._name_}'
+ value = self._value_
+ members = []
+ negative = value < 0
+ if negative:
+ value = ~value
+ for m in self.__class__:
+ if value & m._value_:
+ value &= ~m._value_
+ members.append(f're.{m._name_}')
+ if value:
+ members.append(hex(value))
+ res = '|'.join(members)
+ if negative:
+ if len(members) > 1:
+ res = f'~({res})'
+ else:
+ res = f'~{res}'
+ return res
+ __str__ = object.__str__
+
globals().update(RegexFlag.__members__)
# sre exception
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 137c31de59ae..4817d761a22d 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -2170,6 +2170,18 @@ def test_long_pattern(self):
self.assertEqual(r[:30], "re.compile('Very long long lon")
self.assertEqual(r[-16:], ", re.IGNORECASE)")
+ def test_flags_repr(self):
+ self.assertEqual(repr(re.I), "re.IGNORECASE")
+ self.assertEqual(repr(re.I|re.S|re.X),
+ "re.IGNORECASE|re.DOTALL|re.VERBOSE")
+ self.assertEqual(repr(re.I|re.S|re.X|(1<<20)),
+ "re.IGNORECASE|re.DOTALL|re.VERBOSE|0x100000")
+ self.assertEqual(repr(~re.I), "~re.IGNORECASE")
+ self.assertEqual(repr(~(re.I|re.S|re.X)),
+ "~(re.IGNORECASE|re.DOTALL|re.VERBOSE)")
+ self.assertEqual(repr(~(re.I|re.S|re.X|(1<<20))),
+ "~(re.IGNORECASE|re.DOTALL|re.VERBOSE|0x100000)")
+
class ImplementationTest(unittest.TestCase):
"""
diff --git a/Misc/NEWS.d/next/Library/2019-04-07-14-30-10.bpo-36548.CJQiYw.rst b/Misc/NEWS.d/next/Library/2019-04-07-14-30-10.bpo-36548.CJQiYw.rst
new file mode 100644
index 000000000000..e72bb9117404
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-04-07-14-30-10.bpo-36548.CJQiYw.rst
@@ -0,0 +1 @@
+Improved the repr of regular expression flags.
1
0

bpo-339827: Do not swallow exceptions in the _ssl module. (GH-12756)
by Serhiy Storchaka May 31, 2019
by Serhiy Storchaka May 31, 2019
May 31, 2019
https://github.com/python/cpython/commit/65fb2c08c0d66fcf96fb1eb06270feadec…
commit: 65fb2c08c0d66fcf96fb1eb06270feadec830866
branch: master
author: Serhiy Storchaka <storchaka(a)gmail.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T10:39:15+03:00
summary:
bpo-339827: Do not swallow exceptions in the _ssl module. (GH-12756)
files:
M Modules/_ssl.c
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 755097256acb..4fb7dca9bb04 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -590,19 +590,18 @@ fill_and_set_sslerror(PySSLSocket *sslsock, PyObject *type, int ssl_errno,
key = Py_BuildValue("ii", lib, reason);
if (key == NULL)
goto fail;
- reason_obj = PyDict_GetItem(err_codes_to_names, key);
+ reason_obj = PyDict_GetItemWithError(err_codes_to_names, key);
Py_DECREF(key);
- if (reason_obj == NULL) {
- /* XXX if reason < 100, it might reflect a library number (!!) */
- PyErr_Clear();
+ if (reason_obj == NULL && PyErr_Occurred()) {
+ goto fail;
}
key = PyLong_FromLong(lib);
if (key == NULL)
goto fail;
- lib_obj = PyDict_GetItem(lib_codes_to_names, key);
+ lib_obj = PyDict_GetItemWithError(lib_codes_to_names, key);
Py_DECREF(key);
- if (lib_obj == NULL) {
- PyErr_Clear();
+ if (lib_obj == NULL && PyErr_Occurred()) {
+ goto fail;
}
if (errstr == NULL)
errstr = ERR_reason_error_string(errcode);
@@ -3682,7 +3681,7 @@ _pwinfo_set(_PySSLPasswordInfo *pw_info, PyObject* password,
Py_ssize_t size;
if (PyUnicode_Check(password)) {
- password_bytes = PyUnicode_AsEncodedString(password, NULL, NULL);
+ password_bytes = PyUnicode_AsUTF8String(password);
if (!password_bytes) {
goto error;
}
@@ -3787,13 +3786,17 @@ _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile,
if (keyfile == Py_None)
keyfile = NULL;
if (!PyUnicode_FSConverter(certfile, &certfile_bytes)) {
- PyErr_SetString(PyExc_TypeError,
- "certfile should be a valid filesystem path");
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "certfile should be a valid filesystem path");
+ }
return NULL;
}
if (keyfile && !PyUnicode_FSConverter(keyfile, &keyfile_bytes)) {
- PyErr_SetString(PyExc_TypeError,
- "keyfile should be a valid filesystem path");
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "keyfile should be a valid filesystem path");
+ }
goto error;
}
if (password && password != Py_None) {
@@ -3985,22 +3988,44 @@ _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
goto error;
}
if (cafile && !PyUnicode_FSConverter(cafile, &cafile_bytes)) {
- PyErr_SetString(PyExc_TypeError,
- "cafile should be a valid filesystem path");
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "cafile should be a valid filesystem path");
+ }
goto error;
}
if (capath && !PyUnicode_FSConverter(capath, &capath_bytes)) {
- PyErr_SetString(PyExc_TypeError,
- "capath should be a valid filesystem path");
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_SetString(PyExc_TypeError,
+ "capath should be a valid filesystem path");
+ }
goto error;
}
/* validata cadata type and load cadata */
if (cadata) {
- Py_buffer buf;
- PyObject *cadata_ascii = NULL;
-
- if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE) == 0) {
+ if (PyUnicode_Check(cadata)) {
+ PyObject *cadata_ascii = PyUnicode_AsASCIIString(cadata);
+ if (cadata_ascii == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) {
+ goto invalid_cadata;
+ }
+ goto error;
+ }
+ r = _add_ca_certs(self,
+ PyBytes_AS_STRING(cadata_ascii),
+ PyBytes_GET_SIZE(cadata_ascii),
+ SSL_FILETYPE_PEM);
+ Py_DECREF(cadata_ascii);
+ if (r == -1) {
+ goto error;
+ }
+ }
+ else if (PyObject_CheckBuffer(cadata)) {
+ Py_buffer buf;
+ if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE)) {
+ goto error;
+ }
if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
PyBuffer_Release(&buf);
PyErr_SetString(PyExc_TypeError,
@@ -4013,23 +4038,13 @@ _ssl__SSLContext_load_verify_locations_impl(PySSLContext *self,
if (r == -1) {
goto error;
}
- } else {
- PyErr_Clear();
- cadata_ascii = PyUnicode_AsASCIIString(cadata);
- if (cadata_ascii == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "cadata should be an ASCII string or a "
- "bytes-like object");
- goto error;
- }
- r = _add_ca_certs(self,
- PyBytes_AS_STRING(cadata_ascii),
- PyBytes_GET_SIZE(cadata_ascii),
- SSL_FILETYPE_PEM);
- Py_DECREF(cadata_ascii);
- if (r == -1) {
- goto error;
- }
+ }
+ else {
+ invalid_cadata:
+ PyErr_SetString(PyExc_TypeError,
+ "cadata should be an ASCII string or a "
+ "bytes-like object");
+ goto error;
}
}
1
0

bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
by Benjamin Peterson May 31, 2019
by Benjamin Peterson May 31, 2019
May 31, 2019
https://github.com/python/cpython/commit/530f506ac91338b55cf2be71b1cdf50cb0…
commit: 530f506ac91338b55cf2be71b1cdf50cb077512f
branch: master
author: Jeroen Demeyer <J.Demeyer(a)UGent.be>
committer: Benjamin Peterson <benjamin(a)python.org>
date: 2019-05-30T19:13:39-07:00
summary:
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
files:
M Modules/_blake2/blake2b_impl.c
M Modules/_blake2/blake2s_impl.c
M Modules/_bz2module.c
M Modules/_collectionsmodule.c
M Modules/_csv.c
M Modules/_ctypes/_ctypes.c
M Modules/_ctypes/callbacks.c
M Modules/_ctypes/callproc.c
M Modules/_ctypes/cfield.c
M Modules/_ctypes/stgdict.c
M Modules/_cursesmodule.c
M Modules/_datetimemodule.c
M Modules/_dbmmodule.c
M Modules/_decimal/_decimal.c
M Modules/_elementtree.c
M Modules/_functoolsmodule.c
M Modules/_gdbmmodule.c
M Modules/_hashopenssl.c
M Modules/_io/bufferedio.c
M Modules/_io/bytesio.c
M Modules/_io/fileio.c
M Modules/_io/iobase.c
M Modules/_io/stringio.c
M Modules/_io/textio.c
M Modules/_io/winconsoleio.c
M Modules/_json.c
M Modules/_lsprof.c
M Modules/_lzmamodule.c
M Modules/_multiprocessing/semaphore.c
M Modules/_operator.c
M Modules/_pickle.c
M Modules/_queuemodule.c
M Modules/_randommodule.c
M Modules/_sha3/sha3module.c
M Modules/_sqlite/cache.c
M Modules/_sqlite/connection.c
M Modules/_sqlite/cursor.c
M Modules/_sqlite/prepare_protocol.c
M Modules/_sqlite/row.c
M Modules/_sqlite/statement.c
M Modules/_sre.c
M Modules/_ssl.c
M Modules/_struct.c
M Modules/_testbuffer.c
M Modules/_testcapimodule.c
M Modules/_threadmodule.c
M Modules/_winapi.c
M Modules/_xxsubinterpretersmodule.c
M Modules/arraymodule.c
M Modules/cjkcodecs/multibytecodec.c
M Modules/itertoolsmodule.c
M Modules/md5module.c
M Modules/mmapmodule.c
M Modules/ossaudiodev.c
M Modules/overlapped.c
M Modules/parsermodule.c
M Modules/posixmodule.c
M Modules/pyexpat.c
M Modules/selectmodule.c
M Modules/sha1module.c
M Modules/sha256module.c
M Modules/sha512module.c
M Modules/socketmodule.c
M Modules/unicodedata.c
M Modules/xxmodule.c
M Modules/xxsubtype.c
M Modules/zlibmodule.c
M Objects/boolobject.c
M Objects/bytearrayobject.c
M Objects/bytesobject.c
M Objects/capsule.c
M Objects/cellobject.c
M Objects/classobject.c
M Objects/codeobject.c
M Objects/complexobject.c
M Objects/descrobject.c
M Objects/dictobject.c
M Objects/enumobject.c
M Objects/exceptions.c
M Objects/fileobject.c
M Objects/floatobject.c
M Objects/frameobject.c
M Objects/funcobject.c
M Objects/genobject.c
M Objects/interpreteridobject.c
M Objects/iterobject.c
M Objects/listobject.c
M Objects/longobject.c
M Objects/memoryobject.c
M Objects/methodobject.c
M Objects/moduleobject.c
M Objects/namespaceobject.c
M Objects/object.c
M Objects/odictobject.c
M Objects/rangeobject.c
M Objects/setobject.c
M Objects/sliceobject.c
M Objects/stringlib/unicode_format.h
M Objects/tupleobject.c
M Objects/typeobject.c
M Objects/unicodeobject.c
M Objects/weakrefobject.c
M PC/_msi.c
M PC/winreg.c
M Parser/asdl_c.py
M Python/Python-ast.c
M Python/bltinmodule.c
M Python/symtable.c
M Python/traceback.c
diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c
index 788c15c31d8c..edab31ea222a 100644
--- a/Modules/_blake2/blake2b_impl.c
+++ b/Modules/_blake2/blake2b_impl.c
@@ -401,10 +401,10 @@ PyTypeObject PyBlake2_BLAKE2bType = {
sizeof(BLAKE2bObject), /* tp_basicsize */
0, /* tp_itemsize */
py_blake2b_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /*tp_vectorcall_offset*/
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c
index c8bcedeabd57..ef2f7e1980ff 100644
--- a/Modules/_blake2/blake2s_impl.c
+++ b/Modules/_blake2/blake2s_impl.c
@@ -401,10 +401,10 @@ PyTypeObject PyBlake2_BLAKE2sType = {
sizeof(BLAKE2sObject), /* tp_basicsize */
0, /* tp_itemsize */
py_blake2s_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /*tp_vectorcall_offset*/
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
index b5e5a79d50a5..31bbf6610411 100644
--- a/Modules/_bz2module.c
+++ b/Modules/_bz2module.c
@@ -349,10 +349,10 @@ static PyTypeObject BZ2Compressor_Type = {
sizeof(BZ2Compressor), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)BZ2Compressor_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -690,10 +690,10 @@ static PyTypeObject BZ2Decompressor_Type = {
sizeof(BZ2Decompressor), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)BZ2Decompressor_dealloc,/* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index a40b681d2835..dacea3a02439 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -1620,10 +1620,10 @@ static PyTypeObject deque_type = {
0, /* tp_itemsize */
/* methods */
(destructor)deque_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
deque_repr, /* tp_repr */
&deque_as_number, /* tp_as_number */
&deque_as_sequence, /* tp_as_sequence */
@@ -1788,10 +1788,10 @@ static PyTypeObject dequeiter_type = {
0, /* tp_itemsize */
/* methods */
(destructor)dequeiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1910,10 +1910,10 @@ static PyTypeObject dequereviter_type = {
0, /* tp_itemsize */
/* methods */
(destructor)dequeiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2189,10 +2189,10 @@ static PyTypeObject defdict_type = {
0, /* tp_itemsize */
/* methods */
(destructor)defdict_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)defdict_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2464,10 +2464,10 @@ static PyTypeObject tuplegetter_type = {
0, /* tp_itemsize */
/* methods */
(destructor)tuplegetter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_csv.c b/Modules/_csv.c
index e31b158c601e..7eb9d8b796dd 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -469,10 +469,10 @@ static PyTypeObject Dialect_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)Dialect_dealloc, /* tp_dealloc */
- (printfunc)0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -902,10 +902,10 @@ static PyTypeObject Reader_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)Reader_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -1332,10 +1332,10 @@ static PyTypeObject Writer_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)Writer_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 21b08f8e332d..f7513a3d74c4 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -165,10 +165,10 @@ static PyTypeObject DictRemover_Type = {
sizeof(DictRemoverObject), /* tp_basicsize */
0, /* tp_itemsize */
_DictRemover_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -855,10 +855,10 @@ PyTypeObject PyCStructType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -897,10 +897,10 @@ static PyTypeObject UnionType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -1151,10 +1151,10 @@ PyTypeObject PyCPointerType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -1573,10 +1573,10 @@ PyTypeObject PyCArrayType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -2267,10 +2267,10 @@ PyTypeObject PyCSimpleType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -2503,10 +2503,10 @@ PyTypeObject PyCFuncPtrType_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&CDataType_as_sequence, /* tp_as_sequence */
@@ -2808,10 +2808,10 @@ PyTypeObject PyCData_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
PyCData_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4201,10 +4201,10 @@ PyTypeObject PyCFuncPtr_Type = {
sizeof(PyCFuncPtrObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)PyCFuncPtr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)PyCFuncPtr_repr, /* tp_repr */
&PyCFuncPtr_as_number, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4355,10 +4355,10 @@ static PyTypeObject Struct_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4397,10 +4397,10 @@ static PyTypeObject Union_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4713,10 +4713,10 @@ PyTypeObject PyCArray_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&Array_as_sequence, /* tp_as_sequence */
@@ -4932,10 +4932,10 @@ static PyTypeObject Simple_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)&Simple_repr, /* tp_repr */
&Simple_as_number, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5315,10 +5315,10 @@ PyTypeObject PyCPointer_Type = {
sizeof(CDataObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
&Pointer_as_number, /* tp_as_number */
&Pointer_as_sequence, /* tp_as_sequence */
@@ -5406,10 +5406,10 @@ static PyTypeObject PyComError_Type = {
sizeof(PyBaseExceptionObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 9f793c2771bf..97463b599bc0 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -48,10 +48,10 @@ PyTypeObject PyCThunk_Type = {
sizeof(CThunkObject), /* tp_basicsize */
sizeof(ffi_type), /* tp_itemsize */
CThunkObject_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 8682d5487220..67665246414e 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -555,10 +555,10 @@ PyTypeObject PyCArg_Type = {
sizeof(PyCArgObject),
0,
(destructor)PyCArg_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)PyCArg_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 157c32fd9096..95367d509376 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -305,10 +305,10 @@ PyTypeObject PyCField_Type = {
sizeof(CFieldObject), /* tp_basicsize */
0, /* tp_itemsize */
PyCField_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)PyCField_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 3f8a0316616b..235a4d79ad2c 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -132,10 +132,10 @@ PyTypeObject PyCStgDict_Type = {
sizeof(StgDictObject),
0,
(destructor)PyCStgDict_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 9a1d2efd256e..2435e1c12955 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -2424,10 +2424,10 @@ PyTypeObject PyCursesWindow_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)PyCursesWindow_Dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 83e43a24395b..4d3562cbe64f 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1704,8 +1704,7 @@ build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag)
* Miscellaneous helpers.
*/
-/* For various reasons, we need to use tp_richcompare instead of tp_reserved.
- * The comparisons here all most naturally compute a cmp()-like result.
+/* The comparisons here all most naturally compute a cmp()-like result.
* This little helper turns that into a bool result for rich comparisons.
*/
static PyObject *
@@ -2720,10 +2719,10 @@ static PyTypeObject PyDateTime_DeltaType = {
sizeof(PyDateTime_Delta), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)delta_repr, /* tp_repr */
&delta_as_number, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3431,10 +3430,10 @@ static PyTypeObject PyDateTime_DateType = {
sizeof(PyDateTime_Date), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)date_repr, /* tp_repr */
&date_as_number, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3681,10 +3680,10 @@ static PyTypeObject PyDateTime_TZInfoType = {
sizeof(PyDateTime_TZInfo), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3920,10 +3919,10 @@ static PyTypeObject PyDateTime_TimeZoneType = {
sizeof(PyDateTime_TimeZone), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)timezone_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)timezone_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4583,10 +4582,10 @@ static PyTypeObject PyDateTime_TimeType = {
sizeof(PyDateTime_Time), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)time_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)time_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -6299,10 +6298,10 @@ static PyTypeObject PyDateTime_DateTimeType = {
sizeof(PyDateTime_DateTime), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)datetime_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)datetime_repr, /* tp_repr */
&datetime_as_number, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 21784ae2ce4f..ea0a9d6fc957 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -390,10 +390,10 @@ static PyTypeObject Dbmtype = {
sizeof(dbmobject),
0,
(destructor)dbm_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
&dbm_as_sequence, /*tp_as_sequence*/
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index d977b14f5b0c..e2ac19800315 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -672,10 +672,10 @@ static PyTypeObject PyDecSignalDictMixin_Type =
sizeof(PyDecSignalDictObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
(getattrfunc) 0, /* tp_getattr */
(setattrfunc) 0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc) signaldict_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1665,10 +1665,10 @@ static PyTypeObject PyDecContextManager_Type =
sizeof(PyDecContextManagerObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor) ctxmanager_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
(getattrfunc) 0, /* tp_getattr */
(setattrfunc) 0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc) 0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4694,10 +4694,10 @@ static PyTypeObject PyDec_Type =
sizeof(PyDecObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor) dec_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
(getattrfunc) 0, /* tp_getattr */
(setattrfunc) 0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc) dec_repr, /* tp_repr */
&dec_number_methods, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5380,10 +5380,10 @@ static PyTypeObject PyDecContext_Type =
sizeof(PyDecContextObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor) context_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
(getattrfunc) 0, /* tp_getattr */
(setattrfunc) 0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc) context_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index b1fb3eeffb11..8119c8b1e2b1 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2322,10 +2322,10 @@ static PyTypeObject ElementIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)elementiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4228,10 +4228,10 @@ static PyTypeObject Element_Type = {
"xml.etree.ElementTree.Element", sizeof(ElementObject), 0,
/* methods */
(destructor)element_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)element_repr, /* tp_repr */
0, /* tp_as_number */
&element_as_sequence, /* tp_as_sequence */
@@ -4280,10 +4280,10 @@ static PyTypeObject TreeBuilder_Type = {
"xml.etree.ElementTree.TreeBuilder", sizeof(TreeBuilderObject), 0,
/* methods */
(destructor)treebuilder_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4330,10 +4330,10 @@ static PyTypeObject XMLParser_Type = {
"xml.etree.ElementTree.XMLParser", sizeof(XMLParserObject), 0,
/* methods */
(destructor)xmlparser_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 213fb3ea336c..aca5bad23f58 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -386,10 +386,10 @@ static PyTypeObject partial_type = {
0, /* tp_itemsize */
/* methods */
(destructor)partial_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)partial_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -478,10 +478,10 @@ static PyTypeObject keyobject_type = {
0, /* tp_itemsize */
/* methods */
(destructor)keyobject_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -709,10 +709,10 @@ static PyTypeObject lru_list_elem_type = {
0, /* tp_itemsize */
/* methods */
(destructor)lru_list_elem_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1319,10 +1319,10 @@ static PyTypeObject lru_cache_type = {
0, /* tp_itemsize */
/* methods */
(destructor)lru_cache_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index adf2a5865bfb..77e788752506 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -520,10 +520,10 @@ static PyTypeObject Dbmtype = {
sizeof(dbmobject),
0,
(destructor)dbm_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
&dbm_as_sequence, /*tp_as_sequence*/
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index e560c18b63c3..a806241897fc 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -368,10 +368,10 @@ static PyTypeObject EVPtype = {
0, /*tp_itemsize*/
/* methods */
(destructor)EVP_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)EVP_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 9c0eeb56860e..44e12db6a30e 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -2328,10 +2328,10 @@ PyTypeObject PyBufferedIOBase_Type = {
0, /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2418,10 +2418,10 @@ PyTypeObject PyBufferedReader_Type = {
sizeof(buffered), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)buffered_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
(reprfunc)buffered_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2504,10 +2504,10 @@ PyTypeObject PyBufferedWriter_Type = {
sizeof(buffered), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)buffered_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
(reprfunc)buffered_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2581,10 +2581,10 @@ PyTypeObject PyBufferedRWPair_Type = {
sizeof(rwpair), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)bufferedrwpair_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2675,10 +2675,10 @@ PyTypeObject PyBufferedRandom_Type = {
sizeof(buffered), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)buffered_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
(reprfunc)buffered_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 55e34c677670..32427e44de5b 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -1002,10 +1002,10 @@ PyTypeObject PyBytesIO_Type = {
sizeof(bytesio), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)bytesio_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -1102,10 +1102,10 @@ PyTypeObject _PyBytesIOBuffer_Type = {
sizeof(bytesiobuf), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)bytesiobuf_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 582a8130f622..7f784a34c30d 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -1185,10 +1185,10 @@ PyTypeObject PyFileIO_Type = {
sizeof(fileio),
0,
(destructor)fileio_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)fileio_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 8c8112d10f0b..fab450977ffa 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -841,10 +841,10 @@ PyTypeObject PyIOBase_Type = {
sizeof(iobase), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)iobase_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -1037,10 +1037,10 @@ PyTypeObject PyRawIOBase_Type = {
0, /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index bb5c3736a77a..9e9724db2d33 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -1007,10 +1007,10 @@ PyTypeObject PyStringIO_Type = {
sizeof(stringio), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)stringio_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 3eb0dcc865ba..73b2756afce5 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -169,10 +169,10 @@ PyTypeObject PyTextIOBase_Type = {
0, /*tp_basicsize*/
0, /*tp_itemsize*/
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -3158,10 +3158,10 @@ PyTypeObject PyIncrementalNewlineDecoder_Type = {
sizeof(nldecoder_object), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)incrementalnewlinedecoder_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -3242,10 +3242,10 @@ PyTypeObject PyTextIOWrapper_Type = {
sizeof(textio), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)textiowrapper_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tps_etattr*/
- 0, /*tp_compare */
+ 0, /*tp_as_async*/
(reprfunc)textiowrapper_repr,/*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index 7700bd5b7c0d..ea5d24f950a1 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -1118,10 +1118,10 @@ PyTypeObject PyWindowsConsoleIO_Type = {
sizeof(winconsoleio),
0,
(destructor)winconsoleio_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)winconsoleio_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_json.c b/Modules/_json.c
index 4faa9cc22edf..e3aa997598fc 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1257,10 +1257,10 @@ PyTypeObject PyScannerType = {
sizeof(PyScannerObject), /* tp_basicsize */
0, /* tp_itemsize */
scanner_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1849,10 +1849,10 @@ PyTypeObject PyEncoderType = {
sizeof(PyEncoderObject), /* tp_basicsize */
0, /* tp_itemsize */
encoder_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index c4e0f52389d9..c5a6f4445872 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -754,10 +754,10 @@ static PyTypeObject PyProfiler_Type = {
sizeof(ProfilerObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)profiler_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index 18bc3dc296e0..9e68cbb78af5 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -823,10 +823,10 @@ static PyTypeObject Compressor_type = {
sizeof(Compressor), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)Compressor_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1251,10 +1251,10 @@ static PyTypeObject Decompressor_type = {
sizeof(Decompressor), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)Decompressor_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index cbcc64cb578f..4be2deae3775 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -633,10 +633,10 @@ PyTypeObject _PyMp_SemLockType = {
/* tp_basicsize */ sizeof(SemLockObject),
/* tp_itemsize */ 0,
/* tp_dealloc */ (destructor)semlock_dealloc,
- /* tp_print */ 0,
+ /* tp_vectorcall_offset */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
- /* tp_reserved */ 0,
+ /* tp_as_async */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
diff --git a/Modules/_operator.c b/Modules/_operator.c
index d291ec1f920e..5aa229fa781e 100644
--- a/Modules/_operator.c
+++ b/Modules/_operator.c
@@ -1098,10 +1098,10 @@ static PyTypeObject itemgetter_type = {
0, /* tp_itemsize */
/* methods */
(destructor)itemgetter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)itemgetter_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1443,10 +1443,10 @@ static PyTypeObject attrgetter_type = {
0, /* tp_itemsize */
/* methods */
(destructor)attrgetter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)attrgetter_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1709,10 +1709,10 @@ static PyTypeObject methodcaller_type = {
0, /* tp_itemsize */
/* methods */
(destructor)methodcaller_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)methodcaller_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index a3f02ae8813d..57145beb8fff 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -4867,10 +4867,10 @@ static PyTypeObject PicklerMemoProxyType = {
sizeof(PicklerMemoProxyObject), /*tp_basicsize*/
0,
(destructor)PicklerMemoProxy_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5028,10 +5028,10 @@ static PyTypeObject Pickler_Type = {
sizeof(PicklerObject), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)Pickler_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -7404,10 +7404,10 @@ static PyTypeObject UnpicklerMemoProxyType = {
sizeof(UnpicklerMemoProxyObject), /*tp_basicsize*/
0,
(destructor)UnpicklerMemoProxy_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -7575,10 +7575,10 @@ static PyTypeObject Unpickler_Type = {
sizeof(UnpicklerObject), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)Unpickler_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_queuemodule.c b/Modules/_queuemodule.c
index 35906f08c12b..e033da50a5ee 100644
--- a/Modules/_queuemodule.c
+++ b/Modules/_queuemodule.c
@@ -313,10 +313,10 @@ static PyTypeObject PySimpleQueueType = {
0, /*tp_itemsize*/
/* methods */
(destructor)simplequeue_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 85f6e4029299..4e9ac4073c77 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -534,10 +534,10 @@ static PyTypeObject Random_Type = {
0, /*tp_itemsize*/
/* methods */
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c
index b737363d7172..c1fb6185e243 100644
--- a/Modules/_sha3/sha3module.c
+++ b/Modules/_sha3/sha3module.c
@@ -493,10 +493,10 @@ static PyGetSetDef SHA3_getseters[] = {
0, /* tp_itemsize */ \
/* methods */ \
(destructor)SHA3_dealloc, /* tp_dealloc */ \
- 0, /* tp_print */ \
+ 0, /* tp_vectorcall_offset */ \
0, /* tp_getattr */ \
0, /* tp_setattr */ \
- 0, /* tp_reserved */ \
+ 0, /* tp_as_async */ \
0, /* tp_repr */ \
0, /* tp_as_number */ \
0, /* tp_as_sequence */ \
diff --git a/Modules/_sqlite/cache.c b/Modules/_sqlite/cache.c
index 4270473ae994..4d4180421871 100644
--- a/Modules/_sqlite/cache.c
+++ b/Modules/_sqlite/cache.c
@@ -265,10 +265,10 @@ PyTypeObject pysqlite_NodeType = {
sizeof(pysqlite_Node), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_node_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -307,10 +307,10 @@ PyTypeObject pysqlite_CacheType = {
sizeof(pysqlite_Cache), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_cache_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index e3340bf19f7b..0d6462ef7dc2 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1838,10 +1838,10 @@ PyTypeObject pysqlite_ConnectionType = {
sizeof(pysqlite_Connection), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_connection_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 2bc19311a81d..01b9dc44cb5d 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -922,10 +922,10 @@ PyTypeObject pysqlite_CursorType = {
sizeof(pysqlite_Cursor), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_cursor_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sqlite/prepare_protocol.c b/Modules/_sqlite/prepare_protocol.c
index f2c85f9af6cb..181c7edf96b4 100644
--- a/Modules/_sqlite/prepare_protocol.c
+++ b/Modules/_sqlite/prepare_protocol.c
@@ -39,10 +39,10 @@ PyTypeObject pysqlite_PrepareProtocolType= {
sizeof(pysqlite_PrepareProtocol), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_prepare_protocol_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 3cfbeeb93bba..5c2f40082402 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -231,10 +231,10 @@ PyTypeObject pysqlite_RowType = {
sizeof(pysqlite_Row), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_row_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 575ac69d9030..491294b0209c 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -459,10 +459,10 @@ PyTypeObject pysqlite_StatementType = {
sizeof(pysqlite_Statement), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pysqlite_statement_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 014cc546e345..d4fe588cbe27 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -2594,10 +2594,10 @@ static PyTypeObject Pattern_Type = {
"re.Pattern",
sizeof(PatternObject), sizeof(SRE_CODE),
(destructor)pattern_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)pattern_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2672,10 +2672,10 @@ static PyTypeObject Match_Type = {
"re.Match",
sizeof(MatchObject), sizeof(Py_ssize_t),
(destructor)match_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)match_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2716,10 +2716,10 @@ static PyTypeObject Scanner_Type = {
"_" SRE_MODULE ".SRE_Scanner",
sizeof(ScannerObject), 0,
(destructor)scanner_dealloc,/* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 390a1af1e59d..755097256acb 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -2874,10 +2874,10 @@ static PyTypeObject PySSLSocket_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)PySSL_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -4599,10 +4599,10 @@ static PyTypeObject PySSLContext_Type = {
sizeof(PySSLContext), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)context_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -4824,10 +4824,10 @@ static PyTypeObject PySSLMemoryBIO_Type = {
sizeof(PySSLMemoryBIO), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)memory_bio_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -5021,10 +5021,10 @@ static PyTypeObject PySSLSession_Type = {
sizeof(PySSLSession), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)PySSLSession_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 90839b2ead75..9281c6803f3a 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1669,10 +1669,10 @@ static PyTypeObject unpackiter_type = {
sizeof(unpackiterobject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)unpackiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2029,10 +2029,10 @@ PyTypeObject PyStructType = {
sizeof(PyStructObject),
0,
(destructor)s_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c
index 9d7b3e8b0b3f..d7d3cc8d0d53 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -2646,10 +2646,10 @@ static PyTypeObject NDArray_Type = {
sizeof(NDArrayObject), /* Basic object size */
0, /* Item size for varobject */
(destructor)ndarray_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&ndarray_as_sequence, /* tp_as_sequence */
@@ -2766,10 +2766,10 @@ static PyTypeObject StaticArray_Type = {
sizeof(StaticArrayObject), /* Basic object size */
0, /* Item size for varobject */
(destructor)staticarray_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index a7451c66359d..ca6e87b79c47 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -288,10 +288,10 @@ static PyTypeObject _HashInheritanceTester_Type = {
sizeof(PyObject), /* Basic object size */
0, /* Item size for varobject */
(destructor)PyObject_Del, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5383,10 +5383,10 @@ static PyTypeObject test_structmembersType = {
sizeof(test_structmembers), /* tp_basicsize */
0, /* tp_itemsize */
test_structmembers_free, /* destructor tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5486,10 +5486,10 @@ static PyTypeObject matmulType = {
sizeof(matmulObject), /* tp_basicsize */
0, /* tp_itemsize */
matmulType_dealloc, /* destructor tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
&matmulType_as_number, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5578,7 +5578,7 @@ static PyTypeObject awaitType = {
sizeof(awaitObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)awaitObject_dealloc, /* destructor tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
&awaitType_as_async, /* tp_as_async */
@@ -5623,10 +5623,10 @@ static PyTypeObject PyRecursingInfinitelyError_Type = {
sizeof(PyBaseExceptionObject), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5704,10 +5704,10 @@ static PyTypeObject MyList_Type = {
sizeof(MyListObject),
0,
(destructor)MyList_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 2b1a98f81b1a..d5e40ef999e3 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -232,10 +232,10 @@ static PyTypeObject Locktype = {
0, /*tp_itemsize*/
/* methods */
(destructor)lock_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)lock_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -493,10 +493,10 @@ static PyTypeObject RLocktype = {
0, /*tp_itemsize*/
/* methods */
(destructor)rlock_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)rlock_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -609,10 +609,10 @@ static PyTypeObject localdummytype = {
/* tp_basicsize */ sizeof(localdummyobject),
/* tp_itemsize */ 0,
/* tp_dealloc */ (destructor)localdummy_dealloc,
- /* tp_print */ 0,
+ /* tp_vectorcall_offset */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
- /* tp_reserved */ 0,
+ /* tp_as_async */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
@@ -874,10 +874,10 @@ static PyTypeObject localtype = {
/* tp_basicsize */ sizeof(localobject),
/* tp_itemsize */ 0,
/* tp_dealloc */ (destructor)local_dealloc,
- /* tp_print */ 0,
+ /* tp_vectorcall_offset */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
- /* tp_reserved */ 0,
+ /* tp_as_async */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
index e9dcec6590b6..647075cdb178 100644
--- a/Modules/_winapi.c
+++ b/Modules/_winapi.c
@@ -310,10 +310,10 @@ PyTypeObject OverlappedType = {
/* tp_basicsize */ sizeof(OverlappedObject),
/* tp_itemsize */ 0,
/* tp_dealloc */ (destructor) overlapped_dealloc,
- /* tp_print */ 0,
+ /* tp_vectorcall_offset */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
- /* tp_reserved */ 0,
+ /* tp_as_async */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 0d8e5f3127d5..19d98fd96934 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -1740,7 +1740,7 @@ static PyTypeObject ChannelIDtype = {
sizeof(channelid), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)channelid_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 423cac9910a2..26c90a8a5983 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2839,10 +2839,10 @@ static PyTypeObject Arraytype = {
sizeof(arrayobject),
0,
(destructor)array_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)array_repr, /* tp_repr */
0, /* tp_as_number*/
&array_as_sequence, /* tp_as_sequence*/
@@ -2995,10 +2995,10 @@ static PyTypeObject PyArrayIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)arrayiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index f266e5f33a60..c01a0e5dfadf 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -711,10 +711,10 @@ static PyTypeObject MultibyteCodec_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)multibytecodec_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1088,10 +1088,10 @@ static PyTypeObject MultibyteIncrementalEncoder_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)mbiencoder_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1387,10 +1387,10 @@ static PyTypeObject MultibyteIncrementalDecoder_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)mbidecoder_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1734,10 +1734,10 @@ static PyTypeObject MultibyteStreamReader_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)mbstreamreader_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1980,10 +1980,10 @@ static PyTypeObject MultibyteStreamWriter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)mbstreamwriter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 103029d251e0..00e3cbb31b53 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -241,10 +241,10 @@ static PyTypeObject groupby_type = {
0, /* tp_itemsize */
/* methods */
(destructor)groupby_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -390,10 +390,10 @@ static PyTypeObject _grouper_type = {
0, /* tp_itemsize */
/* methods */
(destructor)_grouper_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -636,10 +636,10 @@ static PyTypeObject teedataobject_type = {
0, /* tp_itemsize */
/* methods */
(destructor)teedataobject_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -825,10 +825,10 @@ static PyTypeObject tee_type = {
0, /* tp_itemsize */
/* methods */
(destructor)tee_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1091,10 +1091,10 @@ static PyTypeObject cycle_type = {
0, /* tp_itemsize */
/* methods */
(destructor)cycle_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1258,10 +1258,10 @@ static PyTypeObject dropwhile_type = {
0, /* tp_itemsize */
/* methods */
(destructor)dropwhile_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1420,10 +1420,10 @@ static PyTypeObject takewhile_type = {
0, /* tp_itemsize */
/* methods */
(destructor)takewhile_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1679,10 +1679,10 @@ static PyTypeObject islice_type = {
0, /* tp_itemsize */
/* methods */
(destructor)islice_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1820,10 +1820,10 @@ static PyTypeObject starmap_type = {
0, /* tp_itemsize */
/* methods */
(destructor)starmap_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2041,10 +2041,10 @@ static PyTypeObject chain_type = {
0, /* tp_itemsize */
/* methods */
(destructor)chain_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2394,10 +2394,10 @@ static PyTypeObject product_type = {
0, /* tp_itemsize */
/* methods */
(destructor)product_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2702,10 +2702,10 @@ static PyTypeObject combinations_type = {
0, /* tp_itemsize */
/* methods */
(destructor)combinations_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3026,10 +3026,10 @@ static PyTypeObject cwr_type = {
0, /* tp_itemsize */
/* methods */
(destructor)cwr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3412,10 +3412,10 @@ static PyTypeObject permutations_type = {
0, /* tp_itemsize */
/* methods */
(destructor)permutations_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3620,10 +3620,10 @@ static PyTypeObject accumulate_type = {
0, /* tp_itemsize */
/* methods */
(destructor)accumulate_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3787,10 +3787,10 @@ static PyTypeObject compress_type = {
0, /* tp_itemsize */
/* methods */
(destructor)compress_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3941,10 +3941,10 @@ static PyTypeObject filterfalse_type = {
0, /* tp_itemsize */
/* methods */
(destructor)filterfalse_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4191,10 +4191,10 @@ static PyTypeObject count_type = {
0, /* tp_itemsize */
/* methods */
(destructor)count_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)count_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4346,10 +4346,10 @@ static PyTypeObject repeat_type = {
0, /* tp_itemsize */
/* methods */
(destructor)repeat_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)repeat_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4623,10 +4623,10 @@ static PyTypeObject ziplongest_type = {
0, /* tp_itemsize */
/* methods */
(destructor)zip_longest_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/md5module.c b/Modules/md5module.c
index d377f0bb4615..b9a351a8c1cd 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -469,10 +469,10 @@ static PyTypeObject MD5type = {
0, /*tp_itemsize*/
/* methods */
MD5_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 36cbaf9fb8b2..755f1669d8d3 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -1045,10 +1045,10 @@ static PyTypeObject mmap_object_type = {
0, /* tp_itemsize */
/* methods */
(destructor) mmap_object_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
&mmap_as_sequence, /*tp_as_sequence*/
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index 2222148c8516..affaf1d9680b 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -965,10 +965,10 @@ static PyTypeObject OSSAudioType = {
0, /*tp_itemsize*/
/* methods */
(destructor)oss_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -999,10 +999,10 @@ static PyTypeObject OSSMixerType = {
0, /*tp_itemsize*/
/* methods */
(destructor)oss_mixer_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
index aad531e47893..44a0a5a83463 100644
--- a/Modules/overlapped.c
+++ b/Modules/overlapped.c
@@ -1765,10 +1765,10 @@ PyTypeObject OverlappedType = {
/* tp_basicsize */ sizeof(OverlappedObject),
/* tp_itemsize */ 0,
/* tp_dealloc */ (destructor) Overlapped_dealloc,
- /* tp_print */ 0,
+ /* tp_vectorcall_offset */ 0,
/* tp_getattr */ 0,
/* tp_setattr */ 0,
- /* tp_reserved */ 0,
+ /* tp_as_async */ 0,
/* tp_repr */ 0,
/* tp_as_number */ 0,
/* tp_as_sequence */ 0,
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 0f681622f288..36f921419153 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -224,10 +224,10 @@ PyTypeObject PyST_Type = {
(int) sizeof(PyST_Object), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)parser_free, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7588d3cde716..77a3700ab22e 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -12580,10 +12580,10 @@ static PyTypeObject DirEntryType = {
0, /* tp_itemsize */
/* methods */
(destructor)DirEntry_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
(reprfunc)DirEntry_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -13018,10 +13018,10 @@ static PyTypeObject ScandirIteratorType = {
0, /* tp_itemsize */
/* methods */
(destructor)ScandirIterator_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_compare */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index 2e8be3706db9..45a1e684d19f 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1468,10 +1468,10 @@ static PyTypeObject Xmlparsetype = {
0, /*tp_itemsize*/
/* methods */
(destructor)xmlparse_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 88130a1ecda0..ed71d8b0d598 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -2219,10 +2219,10 @@ static PyTypeObject poll_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)poll_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2265,10 +2265,10 @@ static PyTypeObject devpoll_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)devpoll_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -2317,10 +2317,10 @@ static PyTypeObject pyEpoll_Type = {
sizeof(pyEpoll_Object), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)pyepoll_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2363,10 +2363,10 @@ static PyTypeObject kqueue_event_Type = {
sizeof(kqueue_event_Object), /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)kqueue_event_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2413,10 +2413,10 @@ static PyTypeObject kqueue_queue_Type = {
sizeof(kqueue_queue_Object), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)kqueue_queue_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/sha1module.c b/Modules/sha1module.c
index 998ebd437dff..ce2ad267e775 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -446,10 +446,10 @@ static PyTypeObject SHA1type = {
0, /*tp_itemsize*/
/* methods */
SHA1_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/sha256module.c b/Modules/sha256module.c
index 20b5f02f5481..b8d6c4cf8006 100644
--- a/Modules/sha256module.c
+++ b/Modules/sha256module.c
@@ -533,10 +533,10 @@ static PyTypeObject SHA224type = {
0, /*tp_itemsize*/
/* methods */
SHA_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -567,10 +567,10 @@ static PyTypeObject SHA256type = {
0, /*tp_itemsize*/
/* methods */
SHA_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/sha512module.c b/Modules/sha512module.c
index e070e4389f4c..98b97917f4ca 100644
--- a/Modules/sha512module.c
+++ b/Modules/sha512module.c
@@ -598,10 +598,10 @@ static PyTypeObject SHA384type = {
0, /*tp_itemsize*/
/* methods */
SHA512_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -632,10 +632,10 @@ static PyTypeObject SHA512type = {
0, /*tp_itemsize*/
/* methods */
SHA512_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index ac1698c6c767..36d13e768cd3 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5274,10 +5274,10 @@ static PyTypeObject sock_type = {
sizeof(PySocketSockObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)sock_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)sock_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 7fdbf332ee74..ae0d4e46f9a4 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -1365,10 +1365,10 @@ static PyTypeObject UCD_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)PyObject_Del, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c
index d546901582fb..0250031d722d 100644
--- a/Modules/xxmodule.c
+++ b/Modules/xxmodule.c
@@ -106,10 +106,10 @@ static PyTypeObject Xxo_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)Xxo_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
(getattrfunc)0, /*tp_getattr*/
(setattrfunc)Xxo_setattr, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -224,10 +224,10 @@ static PyTypeObject Str_Type = {
0, /*tp_itemsize*/
/* methods */
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -279,10 +279,10 @@ static PyTypeObject Null_Type = {
0, /*tp_itemsize*/
/* methods */
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c
index bacbdf153618..031005d36e20 100644
--- a/Modules/xxsubtype.c
+++ b/Modules/xxsubtype.c
@@ -106,10 +106,10 @@ static PyTypeObject spamlist_type = {
sizeof(spamlistobject),
0,
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -197,10 +197,10 @@ static PyTypeObject spamdict_type = {
sizeof(spamdictobject),
0,
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 5778dbb715f9..a3d9ed6646de 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -1315,10 +1315,10 @@ static PyTypeObject Comptype = {
sizeof(compobject),
0,
(destructor)Comp_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -1346,10 +1346,10 @@ static PyTypeObject Decomptype = {
sizeof(compobject),
0,
(destructor)Decomp_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Objects/boolobject.c b/Objects/boolobject.c
index 508ea61f1800..720835b98aa6 100644
--- a/Objects/boolobject.c
+++ b/Objects/boolobject.c
@@ -137,10 +137,10 @@ PyTypeObject PyBool_Type = {
sizeof(struct _longobject),
0,
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
bool_repr, /* tp_repr */
&bool_as_number, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index b9fcc01b7032..c684db767364 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2265,10 +2265,10 @@ PyTypeObject PyByteArray_Type = {
sizeof(PyByteArrayObject),
0,
(destructor)bytearray_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)bytearray_repr, /* tp_repr */
&bytearray_as_number, /* tp_as_number */
&bytearray_as_sequence, /* tp_as_sequence */
@@ -2412,10 +2412,10 @@ PyTypeObject PyByteArrayIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)bytearrayiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index bf7c7da423b7..06c87b0c62d3 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2886,10 +2886,10 @@ PyTypeObject PyBytes_Type = {
PyBytesObject_SIZE,
sizeof(char),
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)bytes_repr, /* tp_repr */
&bytes_as_number, /* tp_as_number */
&bytes_as_sequence, /* tp_as_sequence */
@@ -3165,10 +3165,10 @@ PyTypeObject PyBytesIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)striter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/capsule.c b/Objects/capsule.c
index 4e15b440b170..599893a320db 100644
--- a/Objects/capsule.c
+++ b/Objects/capsule.c
@@ -303,10 +303,10 @@ PyTypeObject PyCapsule_Type = {
0, /*tp_itemsize*/
/* methods */
capsule_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
capsule_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 4e359f889fdc..911cf527a434 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -162,10 +162,10 @@ PyTypeObject PyCell_Type = {
sizeof(PyCellObject),
0,
(destructor)cell_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)cell_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/classobject.c b/Objects/classobject.c
index cfc24460a747..ffd3f875c0e7 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -352,7 +352,7 @@ PyTypeObject PyMethod_Type = {
offsetof(PyMethodObject, vectorcall), /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)method_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -621,10 +621,10 @@ PyTypeObject PyInstanceMethod_Type = {
sizeof(PyInstanceMethodObject), /* tp_basicsize */
0, /* tp_itemsize */
instancemethod_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)instancemethod_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 1e76f26d98fe..886ce4194438 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -831,10 +831,10 @@ PyTypeObject PyCode_Type = {
sizeof(PyCodeObject),
0,
(destructor)code_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)code_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 6d4d8c56f701..a5f95186d625 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -1113,10 +1113,10 @@ PyTypeObject PyComplex_Type = {
sizeof(PyComplexObject),
0,
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)complex_repr, /* tp_repr */
&complex_as_number, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 3aaeaa6e890f..6c95a8726c42 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -546,7 +546,7 @@ PyTypeObject PyMethodDescr_Type = {
offsetof(PyMethodDescrObject, vectorcall), /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)method_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -583,10 +583,10 @@ PyTypeObject PyClassMethodDescr_Type = {
sizeof(PyMethodDescrObject),
0,
(destructor)descr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)method_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -620,10 +620,10 @@ PyTypeObject PyMemberDescr_Type = {
sizeof(PyMemberDescrObject),
0,
(destructor)descr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)member_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -657,10 +657,10 @@ PyTypeObject PyGetSetDescr_Type = {
sizeof(PyGetSetDescrObject),
0,
(destructor)descr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)getset_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -694,10 +694,10 @@ PyTypeObject PyWrapperDescr_Type = {
sizeof(PyWrapperDescrObject),
0,
(destructor)descr_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)wrapperdescr_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1173,10 +1173,10 @@ PyTypeObject _PyMethodWrapper_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)wrapper_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)wrapper_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1569,10 +1569,10 @@ PyTypeObject PyDictProxy_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)mappingproxy_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)mappingproxy_repr, /* tp_repr */
0, /* tp_as_number */
&mappingproxy_as_sequence, /* tp_as_sequence */
@@ -1611,10 +1611,10 @@ PyTypeObject PyProperty_Type = {
0, /* tp_itemsize */
/* methods */
property_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 88ac1a9dcd0f..2b04b0b67965 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -3309,10 +3309,10 @@ PyTypeObject PyDict_Type = {
sizeof(PyDictObject),
0,
(destructor)dict_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)dict_repr, /* tp_repr */
0, /* tp_as_number */
&dict_as_sequence, /* tp_as_sequence */
@@ -3572,10 +3572,10 @@ PyTypeObject PyDictIterKey_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3659,10 +3659,10 @@ PyTypeObject PyDictIterValue_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3766,10 +3766,10 @@ PyTypeObject PyDictIterItem_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4322,10 +4322,10 @@ PyTypeObject PyDictKeys_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictview_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)dictview_repr, /* tp_repr */
&dictviews_as_number, /* tp_as_number */
&dictkeys_as_sequence, /* tp_as_sequence */
@@ -4428,10 +4428,10 @@ PyTypeObject PyDictItems_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictview_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)dictview_repr, /* tp_repr */
&dictviews_as_number, /* tp_as_number */
&dictitems_as_sequence, /* tp_as_sequence */
@@ -4509,10 +4509,10 @@ PyTypeObject PyDictValues_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)dictview_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)dictview_repr, /* tp_repr */
0, /* tp_as_number */
&dictvalues_as_sequence, /* tp_as_sequence */
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index d993a5063fdf..4786297c41ac 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -211,10 +211,10 @@ PyTypeObject PyEnum_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)enum_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -408,10 +408,10 @@ PyTypeObject PyReversed_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)reversed_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 8456a8f18286..568d4959e3a0 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -369,10 +369,10 @@ static PyTypeObject _PyExc_BaseException = {
sizeof(PyBaseExceptionObject), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)BaseException_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /* tp_reserved; */
+ 0, /*tp_as_async*/
(reprfunc)BaseException_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 3b026335d3f8..3791241e5c7c 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -479,10 +479,10 @@ PyTypeObject PyStdPrinter_Type = {
0, /* tp_itemsize */
/* methods */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)stdprinter_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 4ff43bb338f9..2bf7061d4f62 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1913,10 +1913,10 @@ PyTypeObject PyFloat_Type = {
sizeof(PyFloatObject),
0,
(destructor)float_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)float_repr, /* tp_repr */
&float_as_number, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index b668465df3da..5deb9858ce86 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -565,10 +565,10 @@ PyTypeObject PyFrame_Type = {
sizeof(PyFrameObject),
sizeof(PyObject *),
(destructor)frame_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)frame_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 6f5b5d223d9b..df5cc2d3f570 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -653,7 +653,7 @@ PyTypeObject PyFunction_Type = {
offsetof(PyFunctionObject, vectorcall), /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)func_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -825,10 +825,10 @@ PyTypeObject PyClassMethod_Type = {
sizeof(classmethod),
0,
(destructor)cm_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1005,10 +1005,10 @@ PyTypeObject PyStaticMethod_Type = {
sizeof(staticmethod),
0,
(destructor)sm_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 0d0a02d76ccf..2d9a2860a3d2 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -728,7 +728,7 @@ PyTypeObject PyGen_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)gen_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
@@ -982,7 +982,7 @@ PyTypeObject PyCoro_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)gen_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
&coro_as_async, /* tp_as_async */
@@ -1079,7 +1079,7 @@ PyTypeObject _PyCoroWrapper_Type = {
sizeof(PyCoroWrapper), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)coro_wrapper_dealloc, /* destructor tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
@@ -1378,7 +1378,7 @@ PyTypeObject PyAsyncGen_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)gen_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
&async_gen_as_async, /* tp_as_async */
@@ -1609,7 +1609,7 @@ PyTypeObject _PyAsyncGenASend_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)async_gen_asend_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
&async_gen_asend_as_async, /* tp_as_async */
@@ -1706,7 +1706,7 @@ PyTypeObject _PyAsyncGenWrappedValue_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)async_gen_wrapped_val_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
@@ -1962,7 +1962,7 @@ PyTypeObject _PyAsyncGenAThrow_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)async_gen_athrow_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
&async_gen_athrow_as_async, /* tp_as_async */
diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c
index dd142b043d0a..0a1dfa25795f 100644
--- a/Objects/interpreteridobject.c
+++ b/Objects/interpreteridobject.c
@@ -236,7 +236,7 @@ PyTypeObject _PyInterpreterID_Type = {
sizeof(interpid), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)interpid_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_as_async */
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 5bee1e21e65e..da89298edc5c 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -144,10 +144,10 @@ PyTypeObject PySeqIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)iter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -264,10 +264,10 @@ PyTypeObject PyCallIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)calliter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/listobject.c b/Objects/listobject.c
index b210c005da13..233f13dbab0e 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2998,10 +2998,10 @@ PyTypeObject PyList_Type = {
sizeof(PyListObject),
0,
(destructor)list_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)list_repr, /* tp_repr */
0, /* tp_as_number */
&list_as_sequence, /* tp_as_sequence */
@@ -3069,10 +3069,10 @@ PyTypeObject PyListIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)listiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3217,10 +3217,10 @@ PyTypeObject PyListRevIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)listreviter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 3ebbd3e7f9c9..5d2b595621f3 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -5623,10 +5623,10 @@ PyTypeObject PyLong_Type = {
offsetof(PyLongObject, ob_digit), /* tp_basicsize */
sizeof(digit), /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
long_to_decimal_string, /* tp_repr */
&long_as_number, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index 3955c58ee5d2..a873ac1ec1ea 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -147,10 +147,10 @@ PyTypeObject _PyManagedBuffer_Type = {
sizeof(_PyManagedBufferObject),
0,
(destructor)mbuf_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -3155,10 +3155,10 @@ PyTypeObject PyMemoryView_Type = {
offsetof(PyMemoryViewObject, ob_array), /* tp_basicsize */
sizeof(Py_ssize_t), /* tp_itemsize */
(destructor)memory_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)memory_repr, /* tp_repr */
0, /* tp_as_number */
&memory_as_sequence, /* tp_as_sequence */
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 544baee09113..c3bc0184796e 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -275,7 +275,7 @@ PyTypeObject PyCFunction_Type = {
offsetof(PyCFunctionObject, vectorcall), /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)meth_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 20e7d44ab5e1..85134c7a11c6 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -835,10 +835,10 @@ PyTypeObject PyModule_Type = {
sizeof(PyModuleObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)module_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)module_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c
index aba3ff7b05e9..ddad39a91076 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -207,10 +207,10 @@ PyTypeObject _PyNamespace_Type = {
sizeof(_PyNamespaceObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)namespace_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)namespace_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/object.c b/Objects/object.c
index f9c75b7c6a4e..585a9748c846 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -666,7 +666,7 @@ PyObject_Bytes(PyObject *v)
/* For Python 3.0.1 and later, the old three-way comparison has been
completely removed in favour of rich comparisons. PyObject_Compare() and
PyObject_Cmp() are gone, and the builtin cmp function no longer exists.
- The old tp_compare slot has been renamed to tp_reserved, and should no
+ The old tp_compare slot has been renamed to tp_as_async, and should no
longer be used. Use tp_richcompare instead.
See (*) below for practical amendments.
@@ -1638,10 +1638,10 @@ PyTypeObject _PyNone_Type = {
0,
0,
none_dealloc, /*tp_dealloc*/ /*never called*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
none_repr, /*tp_repr*/
&none_as_number, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -1723,10 +1723,10 @@ PyTypeObject _PyNotImplemented_Type = {
0,
0,
notimplemented_dealloc, /*tp_dealloc*/ /*never called*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
NotImplemented_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 773827d85b3a..4c9ae3bc9346 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1551,10 +1551,10 @@ PyTypeObject PyODict_Type = {
sizeof(PyODictObject), /* tp_basicsize */
0, /* tp_itemsize */
(destructor)odict_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)odict_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1823,10 +1823,10 @@ PyTypeObject PyODictIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)odictiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1916,10 +1916,10 @@ PyTypeObject PyODictKeys_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1983,10 +1983,10 @@ PyTypeObject PyODictItems_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2050,10 +2050,10 @@ PyTypeObject PyODictValues_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index ac868f6951c2..239ace6f4235 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -669,10 +669,10 @@ PyTypeObject PyRange_Type = {
sizeof(rangeobject), /* Basic object size */
0, /* Item size for varobject */
(destructor)range_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)range_repr, /* tp_repr */
&range_as_number, /* tp_as_number */
&range_as_sequence, /* tp_as_sequence */
@@ -805,10 +805,10 @@ PyTypeObject PyRangeIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)PyObject_Del, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1008,10 +1008,10 @@ PyTypeObject PyLongRangeIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)longrangeiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 82e9639d2884..bd031600c1be 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -909,10 +909,10 @@ PyTypeObject PySetIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)setiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2118,10 +2118,10 @@ PyTypeObject PySet_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)set_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)set_repr, /* tp_repr */
&set_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
@@ -2216,10 +2216,10 @@ PyTypeObject PyFrozenSet_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)set_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)set_repr, /* tp_repr */
&frozenset_as_number, /* tp_as_number */
&set_as_sequence, /* tp_as_sequence */
@@ -2532,10 +2532,10 @@ static PyTypeObject _PySetDummy_Type = {
0,
0,
dummy_dealloc, /*tp_dealloc*/ /*never called*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
dummy_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 2dcb44fdee57..7c10eb6f638d 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -53,10 +53,10 @@ PyTypeObject PyEllipsis_Type = {
0, /* tp_basicsize */
0, /* tp_itemsize */
0, /*never called*/ /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
ellipsis_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -625,10 +625,10 @@ PyTypeObject PySlice_Type = {
sizeof(PySliceObject), /* Basic object size */
0, /* Item size for varobject */
(destructor)slice_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)slice_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h
index baaac811a56e..0fa54eb32cd3 100644
--- a/Objects/stringlib/unicode_format.h
+++ b/Objects/stringlib/unicode_format.h
@@ -1066,10 +1066,10 @@ static PyTypeObject PyFormatterIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)formatteriter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1202,10 +1202,10 @@ static PyTypeObject PyFieldNameIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)fieldnameiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 72556adb6207..fc2d2742dd2c 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -830,10 +830,10 @@ PyTypeObject PyTuple_Type = {
sizeof(PyTupleObject) - sizeof(PyObject *),
sizeof(PyObject *),
(destructor)tupledealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)tuplerepr, /* tp_repr */
0, /* tp_as_number */
&tuple_as_sequence, /* tp_as_sequence */
@@ -1067,10 +1067,10 @@ PyTypeObject PyTupleIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)tupleiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index ac5a68681d15..64c2ceab5573 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3608,10 +3608,10 @@ PyTypeObject PyType_Type = {
sizeof(PyHeapTypeObject), /* tp_basicsize */
sizeof(PyMemberDef), /* tp_itemsize */
(destructor)type_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)type_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -4784,10 +4784,10 @@ PyTypeObject PyBaseObject_Type = {
sizeof(PyObject), /* tp_basicsize */
0, /* tp_itemsize */
object_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
object_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -5143,7 +5143,6 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
type->tp_setattr = base->tp_setattr;
type->tp_setattro = base->tp_setattro;
}
- /* tp_reserved is ignored */
COPYSLOT(tp_repr);
/* tp_hash see tp_richcompare */
COPYSLOT(tp_call);
@@ -7920,10 +7919,10 @@ PyTypeObject PySuper_Type = {
0, /* tp_itemsize */
/* methods */
super_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
super_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index eafda633a3e2..6ec4127ff385 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8106,10 +8106,10 @@ static PyTypeObject EncodingMapType = {
0, /*tp_itemsize*/
/* methods */
0, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -15155,10 +15155,10 @@ PyTypeObject PyUnicode_Type = {
0, /* tp_itemsize */
/* Slots */
(destructor)unicode_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
unicode_repr, /* tp_repr */
&unicode_as_number, /* tp_as_number */
&unicode_as_sequence, /* tp_as_sequence */
@@ -15483,10 +15483,10 @@ PyTypeObject PyUnicodeIter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)unicodeiter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index ff6d92254f7f..8b8e71031afa 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -354,10 +354,10 @@ _PyWeakref_RefType = {
sizeof(PyWeakReference),
0,
weakref_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
(reprfunc)weakref_repr, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -674,10 +674,10 @@ _PyWeakref_ProxyType = {
0,
/* methods */
(destructor)proxy_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)proxy_repr, /* tp_repr */
&proxy_as_number, /* tp_as_number */
&proxy_as_sequence, /* tp_as_sequence */
@@ -708,10 +708,10 @@ _PyWeakref_CallableProxyType = {
0,
/* methods */
(destructor)proxy_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(unaryfunc)proxy_repr, /* tp_repr */
&proxy_as_number, /* tp_as_number */
&proxy_as_sequence, /* tp_as_sequence */
diff --git a/PC/_msi.c b/PC/_msi.c
index ae30acbc9b48..4c8df5b42b95 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -491,10 +491,10 @@ static PyTypeObject record_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)msiobj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -677,10 +677,10 @@ static PyTypeObject summary_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)msiobj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -826,10 +826,10 @@ static PyTypeObject msiview_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)msiobj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
@@ -944,10 +944,10 @@ static PyTypeObject msidb_Type = {
0, /*tp_itemsize*/
/* methods */
(destructor)msiobj_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
diff --git a/PC/winreg.c b/PC/winreg.c
index 5469fcba0444..5f5fc85d2250 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -355,10 +355,10 @@ PyTypeObject PyHKEY_Type =
sizeof(PyHKEYObject),
0,
PyHKEY_deallocFunc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
&PyHKEY_NumberMethods, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index d84c1b13cf10..582c6ca57b65 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -734,10 +734,10 @@ def visitModule(self, mod):
sizeof(AST_object),
0,
(destructor)ast_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 7c8e438658f7..dc2b1304f1f2 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -640,10 +640,10 @@ static PyTypeObject AST_type = {
sizeof(AST_object),
0,
(destructor)ast_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 48dadcc9d496..56d882d387ee 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -611,10 +611,10 @@ PyTypeObject PyFilter_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)filter_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -1328,10 +1328,10 @@ PyTypeObject PyMap_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)map_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
@@ -2667,10 +2667,10 @@ PyTypeObject PyZip_Type = {
0, /* tp_itemsize */
/* methods */
(destructor)zip_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Python/symtable.c b/Python/symtable.c
index fe6bc9aca4d0..668cc21b2df9 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -140,10 +140,10 @@ PyTypeObject PySTEntry_Type = {
sizeof(PySTEntryObject),
0,
(destructor)ste_dealloc, /* tp_dealloc */
- 0, /* tp_print */
+ 0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
- 0, /* tp_reserved */
+ 0, /* tp_as_async */
(reprfunc)ste_repr, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/Python/traceback.c b/Python/traceback.c
index 04b52ad7680a..0463eb6d8c98 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -192,10 +192,10 @@ PyTypeObject PyTraceBack_Type = {
sizeof(PyTracebackObject),
0,
(destructor)tb_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
+ 0, /*tp_vectorcall_offset*/
0, /*tp_getattr*/
0, /*tp_setattr*/
- 0, /*tp_reserved*/
+ 0, /*tp_as_async*/
0, /*tp_repr*/
0, /*tp_as_number*/
0, /*tp_as_sequence*/
1
0

bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
by Ivan Levkivskyi May 30, 2019
by Ivan Levkivskyi May 30, 2019
May 30, 2019
https://github.com/python/cpython/commit/4c23aff065fb28aba789a211937a2af974…
commit: 4c23aff065fb28aba789a211937a2af974842110
branch: master
author: Ivan Levkivskyi <levkivskyi(a)gmail.com>
committer: GitHub <noreply(a)github.com>
date: 2019-05-31T00:10:07+01:00
summary:
bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`.
As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility.
The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.
files:
A Misc/NEWS.d/next/Library/2019-05-30-21-25-14.bpo-29262.LdIzun.rst
M Doc/library/typing.rst
M Lib/test/test_typing.py
M Lib/typing.py
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 709580ad2159..2575a995817d 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -1021,6 +1021,25 @@ The module defines the following classes, functions and decorators:
a dictionary constructed by merging all the ``__annotations__`` along
``C.__mro__`` in reverse order.
+.. function:: get_origin(typ)
+.. function:: get_args(typ)
+
+ Provide basic introspection for generic types and special typing forms.
+
+ For a typing object of the form ``X[Y, Z, ...]`` these functions return
+ ``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or
+ :mod:`collections` class, it gets normalized to the original class.
+ For unsupported objects return ``None`` and ``()`` correspondingly.
+ Examples::
+
+ assert get_origin(Dict[str, int]) is dict
+ assert get_args(Dict[int, str]) == (int, str)
+
+ assert get_origin(Union[int, str]) is Union
+ assert get_args(Union[int, str]) == (int, str)
+
+ .. versionadded:: 3.8
+
.. decorator:: overload
The ``@overload`` decorator allows describing functions and methods
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index f9c18c84c8f9..a65d639fe9e1 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -15,6 +15,7 @@
from typing import Generic, ClassVar, Final, final, Protocol
from typing import cast, runtime_checkable
from typing import get_type_hints
+from typing import get_origin, get_args
from typing import no_type_check, no_type_check_decorator
from typing import Type
from typing import NewType
@@ -2735,6 +2736,42 @@ def test_get_type_hints_ClassVar(self):
self.assertEqual(gth(G), {'lst': ClassVar[List[T]]})
+class GetUtilitiesTestCase(TestCase):
+ def test_get_origin(self):
+ T = TypeVar('T')
+ class C(Generic[T]): pass
+ self.assertIs(get_origin(C[int]), C)
+ self.assertIs(get_origin(C[T]), C)
+ self.assertIs(get_origin(int), None)
+ self.assertIs(get_origin(ClassVar[int]), ClassVar)
+ self.assertIs(get_origin(Union[int, str]), Union)
+ self.assertIs(get_origin(Literal[42, 43]), Literal)
+ self.assertIs(get_origin(Final[List[int]]), Final)
+ self.assertIs(get_origin(Generic), Generic)
+ self.assertIs(get_origin(Generic[T]), Generic)
+ self.assertIs(get_origin(List[Tuple[T, T]][int]), list)
+
+ def test_get_args(self):
+ T = TypeVar('T')
+ class C(Generic[T]): pass
+ self.assertEqual(get_args(C[int]), (int,))
+ self.assertEqual(get_args(C[T]), (T,))
+ self.assertEqual(get_args(int), ())
+ self.assertEqual(get_args(ClassVar[int]), (int,))
+ self.assertEqual(get_args(Union[int, str]), (int, str))
+ self.assertEqual(get_args(Literal[42, 43]), (42, 43))
+ self.assertEqual(get_args(Final[List[int]]), (List[int],))
+ self.assertEqual(get_args(Union[int, Tuple[T, int]][str]),
+ (int, Tuple[str, int]))
+ self.assertEqual(get_args(typing.Dict[int, Tuple[T, T]][Optional[int]]),
+ (int, Tuple[Optional[int], Optional[int]]))
+ self.assertEqual(get_args(Callable[[], T][int]), ([], int,))
+ self.assertEqual(get_args(Union[int, Callable[[Tuple[T, ...]], str]]),
+ (int, Callable[[Tuple[T, ...]], str]))
+ self.assertEqual(get_args(Tuple[int, ...]), (int, ...))
+ self.assertEqual(get_args(Tuple[()]), ((),))
+
+
class CollectionsAbcTests(BaseTestCase):
def test_hashable(self):
diff --git a/Lib/typing.py b/Lib/typing.py
index 3b4e9df0482e..16ccfad049f4 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -99,6 +99,8 @@
'AnyStr',
'cast',
'final',
+ 'get_args',
+ 'get_origin',
'get_type_hints',
'NewType',
'no_type_check',
@@ -1253,6 +1255,46 @@ def get_type_hints(obj, globalns=None, localns=None):
return hints
+def get_origin(tp):
+ """Get the unsubscripted version of a type.
+
+ This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
+ Return None for unsupported types. Examples::
+
+ get_origin(Literal[42]) is Literal
+ get_origin(int) is None
+ get_origin(ClassVar[int]) is ClassVar
+ get_origin(Generic) is Generic
+ get_origin(Generic[T]) is Generic
+ get_origin(Union[T, int]) is Union
+ get_origin(List[Tuple[T, T]][int]) == list
+ """
+ if isinstance(tp, _GenericAlias):
+ return tp.__origin__
+ if tp is Generic:
+ return Generic
+ return None
+
+
+def get_args(tp):
+ """Get type arguments with all substitutions performed.
+
+ For unions, basic simplifications used by Union constructor are performed.
+ Examples::
+ get_args(Dict[str, int]) == (str, int)
+ get_args(int) == ()
+ get_args(Union[int, Union[T, int], str][int]) == (int, str)
+ get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
+ get_args(Callable[[], T][int]) == ([], int)
+ """
+ if isinstance(tp, _GenericAlias):
+ res = tp.__args__
+ if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
+ res = (list(res[:-1]), res[-1])
+ return res
+ return ()
+
+
def no_type_check(arg):
"""Decorator to indicate that annotations are not type hints.
diff --git a/Misc/NEWS.d/next/Library/2019-05-30-21-25-14.bpo-29262.LdIzun.rst b/Misc/NEWS.d/next/Library/2019-05-30-21-25-14.bpo-29262.LdIzun.rst
new file mode 100644
index 000000000000..e1154ef575a5
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2019-05-30-21-25-14.bpo-29262.LdIzun.rst
@@ -0,0 +1 @@
+Add ``get_origin()`` and ``get_args()`` introspection helpers to ``typing`` module.
\ No newline at end of file
1
0

bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)
by Miss Islington (bot) May 30, 2019
by Miss Islington (bot) May 30, 2019
May 30, 2019
https://github.com/python/cpython/commit/2a58b0636d1f620f8a85a2e4c030cc1055…
commit: 2a58b0636d1f620f8a85a2e4c030cc10551936a5
branch: master
author: Anthony Sottile <asottile(a)umich.edu>
committer: Miss Islington (bot) <31488909+miss-islington(a)users.noreply.github.com>
date: 2019-05-30T15:06:32-07:00
summary:
bpo-5028: Fix up rest of documentation for tokenize documenting line (GH-13686)
https://bugs.python.org/issue5028
files:
M Doc/library/tokenize.rst
M Lib/lib2to3/pgen2/tokenize.py
M Lib/tokenize.py
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
index c89d3d4b082f..b208ba46d17d 100644
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -39,8 +39,8 @@ The primary entry point is a :term:`generator`:
column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of
ints specifying the row and column where the token ends in the source; and
the line on which the token was found. The line passed (the last tuple item)
- is the *physical* line; continuation lines are included. The 5 tuple is
- returned as a :term:`named tuple` with the field names:
+ is the *physical* line. The 5 tuple is returned as a :term:`named tuple`
+ with the field names:
``type string start end line``.
The returned :term:`named tuple` has an additional property named
diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py
index 0f9fde3fb0d5..7924ff3cd582 100644
--- a/Lib/lib2to3/pgen2/tokenize.py
+++ b/Lib/lib2to3/pgen2/tokenize.py
@@ -346,7 +346,7 @@ def generate_tokens(readline):
column where the token begins in the source; a 2-tuple (erow, ecol) of
ints specifying the row and column where the token ends in the source;
and the line on which the token was found. The line passed is the
- physical line; continuation lines are included.
+ physical line.
"""
lnum = parenlev = continued = 0
contstr, needcont = '', 0
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 738fb71d188b..1aee21b5e18f 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -415,7 +415,7 @@ def tokenize(readline):
column where the token begins in the source; a 2-tuple (erow, ecol) of
ints specifying the row and column where the token ends in the source;
and the line on which the token was found. The line passed is the
- physical line; continuation lines are included.
+ physical line.
The first token sequence will always be an ENCODING token
which tells you which encoding was used to decode the bytes stream.
1
0