Kirill Simonov avatar Kirill Simonov committed 8dbcb3d

Relaxed domination rules for adapters with multiple signatures.

Comments (0)

Files changed (1)

src/htsql/adapter.py

         # (2) The signature of the component is more specific than
         #     the signature of the other component.
         # Note: In case if the component has more than one signature,
-        # we require that each of the signatures is equal or more specific
-        # than some signature of the other component and at least one
-        # signature is strictly more specific than some signature
-        # of the other component.
-        is_greater = True
-        is_strict = False
+        # we require that at least one of the signatures is more
+        # specific than some signature of the other component.  This
+        # rule does not guarantee anti-symmetricity, so ambiguously
+        # defined implementations may make the ordering ill defined.
+        # Validness of the ordering is verified in `Component.realize()`.
         for self_signature in component.signatures:
             for other_signature in other.signatures:
                 if aresubclasses(self_signature, other_signature):
                     if self_signature != other_signature:
-                        is_strict = True
-                    break
-            else:
-                is_greater = False
-        if is_greater and is_strict:
-            return True
+                        return True
 
         return False
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.