Add method add_conversion_points into a ConvRepo
This commit is contained in:
@@ -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" }
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user