ovld 0.5.8__tar.gz → 0.5.9__tar.gz
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-0.5.8 → ovld-0.5.9}/PKG-INFO +1 -1
- {ovld-0.5.8 → ovld-0.5.9}/pyproject.toml +1 -1
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/mro.py +10 -1
- ovld-0.5.9/src/ovld/version.py +1 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_mro.py +6 -0
- {ovld-0.5.8 → ovld-0.5.9}/uv.lock +1 -1
- ovld-0.5.8/src/ovld/version.py +0 -1
- {ovld-0.5.8 → ovld-0.5.9}/.github/workflows/publish.yml +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/.github/workflows/python-package.yml +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/.gitignore +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/.python-version +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/.readthedocs.yaml +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/LICENSE +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/README.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/__init__.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/common.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/conftest.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_add.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_ast.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_calc.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_fib.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_multer.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_regexp.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_trivial.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/benchmarks/test_tweaknum.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/codegen.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/compare.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/dependent.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/features.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/index.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/medley.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/types.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/docs/usage.md +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/mkdocs.yml +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/__init__.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/abc.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/codegen.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/core.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/dependent.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/medley.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/py.typed +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/recode.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/signatures.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/typemap.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/types.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/src/ovld/utils.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/__init__.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/modules/gingerbread.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_abc.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_dataclass_gen.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_method.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_method_metaclass.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_method_per_instance.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_simple.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen/test_variant_generation.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_codegen.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_dependent.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_examples.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_global.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_medley.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld/test_display.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld/test_display_more.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld/test_doc.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld/test_doc2.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld/test_method_doc.txt +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_ovld.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_typemap.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_types.py +0 -0
- {ovld-0.5.8 → ovld-0.5.9}/tests/test_utils.py +0 -0
@@ -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(
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
version = "0.5.9"
|
@@ -150,6 +150,12 @@ def test_subclasscheck_anntype():
|
|
150
150
|
assert not subclasscheck(type[int], type[Annotated[int, "hello"]])
|
151
151
|
|
152
152
|
|
153
|
+
def test_subclasscheck_anntype_type():
|
154
|
+
assert subclasscheck(type[Annotated[int, "hello"]], type[Annotated[int, str]])
|
155
|
+
assert subclasscheck(type[Annotated[int, str]], type[Annotated[object, str]])
|
156
|
+
assert not subclasscheck(type[Annotated[int, "hello"]], type[Annotated[int, int]])
|
157
|
+
|
158
|
+
|
153
159
|
@pytest.mark.skipif(
|
154
160
|
sys.version_info < (3, 12), reason="Python 3.11 is more strict on Annotated"
|
155
161
|
)
|
ovld-0.5.8/src/ovld/version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
version = "0.5.8"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|