Skip to content

Commit 609858f

Browse files
committed
_find_impl
1 parent dc94cba commit 609858f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/functools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ def is_strict_base(typ):
843843
mro.append(subcls)
844844
return _c3_mro(cls, abcs=mro)
845845

846-
def _find_impl(cls, registry):
847-
"""Returns the best matching implementation from *registry* for type *cls*.
846+
def _find_impl(cls_obj, registry):
847+
"""Returns the best matching implementation from *registry* for type *cls_obj*.
848848
849849
Where there is no registered implementation for a specific type, its method
850850
resolution order is used to find a more generic implementation.
@@ -853,6 +853,7 @@ def _find_impl(cls, registry):
853853
*object* type, this function may return None.
854854
855855
"""
856+
cls = cls_obj if isinstance(cls_obj, type) else cls_obj.__class__
856857
mro = _compose_mro(cls, registry.keys())
857858
match = None
858859
for t in mro:

0 commit comments

Comments
 (0)