From eedb9ea207328179dec943366747571c2dfae27b Mon Sep 17 00:00:00 2001 From: JoBe <165585785+JoBeGaming@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:40:10 +0100 Subject: [PATCH] Removed duplicated definition of `lookup_special` in `types.py`. --- Lib/types.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Lib/types.py b/Lib/types.py index 9419fc850063e4..9c172619f525b5 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -112,29 +112,6 @@ def lookup_special(object, name, default=_sentinel): del sys, inspect _f, _g, _C, _c, _ag, _cell_factory # Not for export - def lookup_special(object, name, *args): - """Lookup method name `name` on `object` skipping the instance - dictionary. - - `name` must be a string. If the named special attribute does not exist, - `default` is returned if provided, otherwise AttributeError is raised. - """ - from inspect import getattr_static - cls = type(object) - if not isinstance(name, str): - raise TypeError( - f"attribute name must be string, not '{type(name).__name__}'" - ) - try: - descr = getattr_static(cls, name) - except AttributeError: - if args: - return args[0] - raise - if hasattr(descr, "__get__"): - return descr.__get__(object, cls) - return descr - # Provide a PEP 3115 compliant mechanism for class creation def new_class(name, bases=(), kwds=None, exec_body=None):