File tree Expand file tree Collapse file tree 3 files changed +9
-33
lines changed Expand file tree Collapse file tree 3 files changed +9
-33
lines changed Original file line number Diff line number Diff line change 42
42
CxxWrapper as _CxxWrapper ,
43
43
copy_cxx_mem_fns as _copy_cxx_mem_fns ,
44
44
to_cxx as _to_cxx ,
45
+ wrap_cxx_free_fn as _wrap_cxx_free_fn ,
45
46
)
46
47
47
48
@@ -144,15 +145,5 @@ def number_of_classes(self: Self) -> int:
144
145
_copy_cxx_mem_fns (_CongruenceWord , Congruence )
145
146
146
147
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):
174
174
175
175
# TODO proper annotations
176
176
def 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 ))
181
179
182
180
cxx_free_fn_wrapper .__name__ = cxx_free_fn .__name__
183
181
cxx_free_fn_wrapper .__doc__ = cxx_free_fn .__doc__
Original file line number Diff line number Diff line change 40
40
CxxWrapper as _CxxWrapper ,
41
41
copy_cxx_mem_fns as _copy_cxx_mem_fns ,
42
42
to_cxx as _to_cxx ,
43
+ wrap_cxx_free_fn as _wrap_cxx_free_fn ,
43
44
)
44
45
45
46
@@ -85,20 +86,6 @@ def small_overlap_class(self: Self) -> int:
85
86
_copy_cxx_mem_fns (_KambitesWord , Kambites )
86
87
87
88
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