diff --git a/pyproject.toml b/pyproject.toml index 26613da..dd4b164 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "breakshaft" -version = "0.1.6.post1" +version = "0.1.6.post2" description = "Library for in-time codegen for type conversion" authors = [ { name = "nikto_b", email = "niktob560@yandex.ru" } diff --git a/src/breakshaft/convertor.py b/src/breakshaft/convertor.py index a8f24cf..4ad98a5 100644 --- a/src/breakshaft/convertor.py +++ b/src/breakshaft/convertor.py @@ -79,11 +79,14 @@ class ConvRepo: def convertor_set(self): return self._convertor_set + def add_conversion_points(self, conversion_points: Iterable[ConversionPoint]): + self._convertor_set |= set(conversion_points) + def add_injector(self, func: Callable, rettype: Optional[type] = None, type_remap: Optional[dict[str, type]] = None): - self._convertor_set |= set(ConversionPoint.from_fn(func, rettype=rettype, type_remap=type_remap)) + self.add_conversion_points(ConversionPoint.from_fn(func, rettype=rettype, type_remap=type_remap)) def _callseq_from_callgraph(self, cg: Callgraph) -> list[ConversionPoint]: if len(cg.variants) == 0: