File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 CxxWrapper as _CxxWrapper ,
4343 copy_cxx_mem_fns as _copy_cxx_mem_fns ,
4444 to_cxx as _to_cxx ,
45+ wrap_cxx_free_fn as _wrap_cxx_free_fn ,
4546)
4647
4748
@@ -144,15 +145,5 @@ def number_of_classes(self: Self) -> int:
144145_copy_cxx_mem_fns (_CongruenceWord , Congruence )
145146
146147
147- @_copydoc (_congruence_partition )
148- def partition (
149- c : Congruence , words : List [List [int ]] | List [str ]
150- ) -> List [List [List [int ]]] | List [List [str ]]:
151- return _congruence_partition (_to_cxx (c ), words )
152-
153-
154- @_copydoc (_congruence_non_trivial_classes )
155- def non_trivial_classes (
156- c : Congruence , words : List [List [int ]] | List [str ]
157- ) -> List [List [List [int ]]] | List [List [str ]]:
158- return _congruence_non_trivial_classes (c ._cxx_obj , words )
148+ partition = _wrap_cxx_free_fn (_congruence_partition )
149+ non_trivial_classes = _wrap_cxx_free_fn (_congruence_non_trivial_classes )
Original file line number Diff line number Diff line change @@ -174,10 +174,8 @@ def cxx_mem_fn_wrapper(self, *args):
174174
175175# TODO proper annotations
176176def wrap_cxx_free_fn (cxx_free_fn : pybind11_type ) -> Callable :
177- def cxx_free_fn_wrapper (self , * args ):
178- return getattr (self ._cxx_obj , cxx_free_fn .__name__ )(
179- * (to_cxx (x ) for x in args )
180- )
177+ def cxx_free_fn_wrapper (* args ):
178+ return cxx_free_fn (* (to_cxx (x ) for x in args ))
181179
182180 cxx_free_fn_wrapper .__name__ = cxx_free_fn .__name__
183181 cxx_free_fn_wrapper .__doc__ = cxx_free_fn .__doc__
Original file line number Diff line number Diff line change 4040 CxxWrapper as _CxxWrapper ,
4141 copy_cxx_mem_fns as _copy_cxx_mem_fns ,
4242 to_cxx as _to_cxx ,
43+ wrap_cxx_free_fn as _wrap_cxx_free_fn ,
4344)
4445
4546
@@ -85,20 +86,6 @@ def small_overlap_class(self: Self) -> int:
8586_copy_cxx_mem_fns (_KambitesWord , Kambites )
8687
8788
88- @_copydoc (_kambites_partition )
89- def partition (
90- k : Kambites , words : List [List [int ]] | List [str ]
91- ) -> List [List [List [int ]]] | List [List [str ]]:
92- return _kambites_partition (_to_cxx (k ), words )
93-
94-
95- @_copydoc (_kambites_non_trivial_classes )
96- def non_trivial_classes (
97- k : Kambites , words : List [List [int ]] | List [str ]
98- ) -> List [List [List [int ]]] | List [List [str ]]:
99- return _kambites_non_trivial_classes (_to_cxx (k ), words )
100-
101-
102- @_copydoc (_kambites_normal_forms )
103- def normal_forms (k : Kambites ) -> List [List [int ]] | List [str ]:
104- return _kambites_normal_forms (_to_cxx (k ))
89+ partition = _wrap_cxx_free_fn (_kambites_partition )
90+ non_trivial_classes = _wrap_cxx_free_fn (_kambites_non_trivial_classes )
91+ normal_forms = _wrap_cxx_free_fn (_kambites_normal_forms )
You can’t perform that action at this time.
0 commit comments