Skip to content

Commit

Permalink
96: More CR changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-mitchell committed Jul 21, 2023
1 parent 70f2564 commit ef94282
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pure_interface/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,7 @@ def _get_adapter(cls: AnInterfaceType, obj_type: Type) -> Optional[Callable]:
"""
adapters = {} # type: ignore
# registered interfaces can come from cls.register(AnotherInterface) or @sub_interface_of(AnotherInterface)(cls)
registered_interfaces = [iface for iface in cls._pi.registered_types if type_is_interface(iface)]
candidate_interfaces = [cls] + cls.__subclasses__() + registered_interfaces
candidate_interfaces = [cls] + cls.__subclasses__() + list(cls._pi.registered_types)
candidate_interfaces.reverse() # prefer this class over sub-class adapters
for subcls in candidate_interfaces:
if type_is_interface(subcls):
Expand Down

0 comments on commit ef94282

Please sign in to comment.