Commit 4f8c328a authored by Tres Seaver's avatar Tres Seaver

Optimize further by letting isinstance do the heavy lifting in C.

Also makes the intent clearer.
parent eb7a701d
...@@ -59,12 +59,7 @@ def maybeWarnDeprecated(ob, method_name): ...@@ -59,12 +59,7 @@ def maybeWarnDeprecated(ob, method_name):
if getattr(getattr(ob, method_name), '__five_method__', False): if getattr(getattr(ob, method_name), '__five_method__', False):
# Method knows it's deprecated # Method knows it's deprecated
return return
ob_type = type(ob) if isinstance(ob, tuple(deprecatedManageAddDeleteClasses)):
# Quick check for directly deprecated classes
if ob_type in deprecatedManageAddDeleteClasses:
return
if any(issubclass(ob_type, cls)
for cls in deprecatedManageAddDeleteClasses):
return return
class_ = ob.__class__ class_ = ob.__class__
LOG.debug( LOG.debug(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment