ovld 0.5.8__py3-none-any.whl → 0.5.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ovld/mro.py CHANGED
@@ -134,6 +134,15 @@ def typeorder(t1, t2):
134
134
  return Order.NONE
135
135
 
136
136
 
137
+ def _find_ann(main, others):
138
+ if main in others:
139
+ return True
140
+ elif isinstance(main, type):
141
+ return any(isinstance(x, main) for x in others)
142
+ else:
143
+ return False
144
+
145
+
137
146
  def subclasscheck(t1, t2):
138
147
  """Check whether t1 is a "subclass" of t2."""
139
148
  if t1 == t2 or t2 is Any:
@@ -165,7 +174,7 @@ def subclasscheck(t1, t2):
165
174
  if o1 is Annotated and o2 is Annotated:
166
175
  t1, *a1 = get_args(t1)
167
176
  t2, *a2 = get_args(t2)
168
- return subclasscheck(t1, t2) and any(ann in a2 for ann in a1)
177
+ return subclasscheck(t1, t2) and any(_find_ann(main, a1) for main in a2)
169
178
 
170
179
  if o1 is Annotated:
171
180
  return t2 is Annotated
ovld/version.py CHANGED
@@ -1 +1 @@
1
- version = "0.5.8"
1
+ version = "0.5.9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ovld
3
- Version: 0.5.8
3
+ Version: 0.5.9
4
4
  Summary: Overloading Python functions
5
5
  Project-URL: Homepage, https://ovld.readthedocs.io/en/latest/
6
6
  Project-URL: Documentation, https://ovld.readthedocs.io/en/latest/
@@ -4,15 +4,15 @@ ovld/codegen.py,sha256=27tmamlanuTPDT-x31ISyqP0wGKW9BCFZJGVyq9qLg8,9728
4
4
  ovld/core.py,sha256=WqZ1lvcAGSri02XZeY73Bj5AKB9RYBCAvHLbyns8u68,17792
5
5
  ovld/dependent.py,sha256=JIgsc_5ddPH51_2IrZ6JW6bWE5RyrrrOwR2e9UvDhZ4,8922
6
6
  ovld/medley.py,sha256=Pq6j4qPl8osyQ4Xp-ktnt2uJXytC9Jo70toS5LYHRf8,12840
7
- ovld/mro.py,sha256=5h0JoMGUYNoj4RmVi2uElZB9PGWj_IEvLvBWYtAtYRw,6033
7
+ ovld/mro.py,sha256=-M-BFtmSSEZ39eMPpZ4c2xTAwE43zuJu_jtlxAEfuPo,6238
8
8
  ovld/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  ovld/recode.py,sha256=vXg9XLExp_9LdAHO0JWR4wvwHhpOLu2Xcrg9ZYg1nms,16407
10
10
  ovld/signatures.py,sha256=Q8JucSOun0ESGx14aWtHtBzLEiM6FxY5HP3imyqXoDo,8984
11
11
  ovld/typemap.py,sha256=wkLuCc6xa2VZJOMaAhuYYgnNrywhovkQwbkBnoRfCsY,13985
12
12
  ovld/types.py,sha256=CRL6Vuzg5moXgAAhIj2698GvZoyF4HWbUDYz2hKt6us,13373
13
13
  ovld/utils.py,sha256=8nvycMWpTmwGq7ojjDA7yi2NdkU78NBdUlvRk_vDECY,5086
14
- ovld/version.py,sha256=IAa3xnF9S8cqANXapf16xG7B-aQG7AHxJ3Iio8QzYuc,18
15
- ovld-0.5.8.dist-info/METADATA,sha256=b1vd6kxUQ18CJ7t6b3H8zAmyTZaCpFowtZNq_sxJhSE,10458
16
- ovld-0.5.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- ovld-0.5.8.dist-info/licenses/LICENSE,sha256=cSwNTIzd1cbI89xt3PeZZYJP2y3j8Zus4bXgo4svpX8,1066
18
- ovld-0.5.8.dist-info/RECORD,,
14
+ ovld/version.py,sha256=fa8mYJ1rRpnvSWOBQjwJEtqO9AqOw8j-QGkxIJqUaM0,18
15
+ ovld-0.5.9.dist-info/METADATA,sha256=7TIVCS1fVm0Oq7GcG5KR9JRNWQa6JkM-c6euVUu3e6g,10458
16
+ ovld-0.5.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ ovld-0.5.9.dist-info/licenses/LICENSE,sha256=cSwNTIzd1cbI89xt3PeZZYJP2y3j8Zus4bXgo4svpX8,1066
18
+ ovld-0.5.9.dist-info/RECORD,,
File without changes