ovld 0.5.1__tar.gz → 0.5.2__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.1 → ovld-0.5.2}/PKG-INFO +1 -1
- {ovld-0.5.1 → ovld-0.5.2}/pyproject.toml +2 -2
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/medley.py +3 -1
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/mro.py +1 -1
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/recode.py +12 -1
- ovld-0.5.2/src/ovld/version.py +1 -0
- ovld-0.5.1/src/ovld/version.py +0 -1
- {ovld-0.5.1 → ovld-0.5.2}/.github/workflows/publish.yml +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/.github/workflows/python-package.yml +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/.gitignore +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/.python-version +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/.readthedocs.yaml +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/LICENSE +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/README.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/__init__.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/common.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_add.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_ast.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_calc.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_fib.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_multer.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_regexp.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_trivial.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/benchmarks/test_tweaknum.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/codegen.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/compare.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/dependent.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/features.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/index.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/medley.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/types.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/docs/usage.md +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/mkdocs.yml +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/__init__.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/abc.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/codegen.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/core.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/dependent.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/py.typed +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/signatures.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/typemap.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/types.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/src/ovld/utils.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/__init__.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/modules/gingerbread.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_abc.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_dataclass_gen.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_method.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_method_metaclass.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_method_per_instance.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_simple.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen/test_variant_generation.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_codegen.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_dependent.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_examples.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_global.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_medley.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_mro.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld/test_display.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld/test_display_more.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld/test_doc.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld/test_doc2.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld/test_method_doc.txt +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_ovld.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_typemap.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_types.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/tests/test_utils.py +0 -0
- {ovld-0.5.1 → ovld-0.5.2}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "ovld"
|
3
|
-
version = "0.5.
|
3
|
+
version = "0.5.2"
|
4
4
|
description = "Overloading Python functions"
|
5
5
|
authors = [
|
6
6
|
{ name = "Olivier Breuleux", email = "breuleux@gmail.com" }
|
@@ -32,7 +32,7 @@ benchmark = [
|
|
32
32
|
"multimethod>=1.12",
|
33
33
|
"multipledispatch>=1.0.0",
|
34
34
|
"plum-dispatch>=2.5.2",
|
35
|
-
"runtype>=0.5.
|
35
|
+
"runtype>=0.5.2",
|
36
36
|
]
|
37
37
|
|
38
38
|
[tool.hatch.build.targets.wheel]
|
@@ -178,7 +178,9 @@ class medley_cls_dict(dict):
|
|
178
178
|
|
179
179
|
combiner = self._combiners.get(attr, None)
|
180
180
|
if combiner is None:
|
181
|
-
if
|
181
|
+
if to_ovld(value, force=False):
|
182
|
+
combiner = BuildOvld(attr)
|
183
|
+
elif inspect.isfunction(value):
|
182
184
|
combiner = self._default_combiner(attr)
|
183
185
|
else:
|
184
186
|
combiner = KeepLast(attr)
|
@@ -496,7 +496,18 @@ def recode(fn, ovld, syms, newname):
|
|
496
496
|
if fn.__closure__:
|
497
497
|
new = closure_wrap(new.body[0], "irrelevant", fn.__code__.co_freevars)
|
498
498
|
ast.fix_missing_locations(new)
|
499
|
-
|
499
|
+
line_delta = fn.__code__.co_firstlineno - 1
|
500
|
+
col_delta = len(firstline := src.split("\n", 1)[0]) - len(firstline.lstrip())
|
501
|
+
for node in ast.walk(new):
|
502
|
+
if hasattr(node, "lineno"):
|
503
|
+
node.lineno += line_delta
|
504
|
+
if hasattr(node, "end_lineno"):
|
505
|
+
node.end_lineno += line_delta
|
506
|
+
if hasattr(node, "col_offset"):
|
507
|
+
node.col_offset += col_delta
|
508
|
+
if hasattr(node, "end_col_offset"):
|
509
|
+
node.end_col_offset += col_delta
|
510
|
+
|
500
511
|
res = compile(new, mode="exec", filename=fn.__code__.co_filename)
|
501
512
|
if fn.__closure__:
|
502
513
|
res = [x for x in res.co_consts if isinstance(x, CodeType)][0]
|
@@ -0,0 +1 @@
|
|
1
|
+
version = "0.5.2"
|
ovld-0.5.1/src/ovld/version.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
version = "0.5.1"
|
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
|