]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-149436: Speed up inspect.getattr_static for the common-metaclass case (#149437)
authorPieter Eendebak <pieter.eendebak@gmail.com>
Sun, 10 May 2026 02:52:52 +0000 (04:52 +0200)
committerGitHub <noreply@github.com>
Sun, 10 May 2026 02:52:52 +0000 (19:52 -0700)
commita2c1657cab8daed6cf6236d67967372de7442d8b
treefffb12158d3e65c23cbed0dbfc68edb077dfcfdd
parentcc5cf14ae0a3665ba9d192cc4152c0a46a9dab2f
gh-149436: Speed up inspect.getattr_static for the common-metaclass case (#149437)

Consecutive MRO entries usually share their metaclass, so call
_shadowed_dict at most once per distinct metaclass.
Lib/inspect.py
Misc/NEWS.d/next/Library/2026-05-08-14-24-16.gh-issue-149436.dEV02X.rst [new file with mode: 0644]