@@ -23,7 +23,7 @@ def func(a: int) -> float:
2323 outputs = sorted (list_fields (SampleDef .Outputs ), key = sort_key )
2424 assert inputs == [
2525 python .arg (name = "a" , type = int ),
26- python .arg (name = "function" , type = ty .Callable , default = func ),
26+ python .arg (name = "function" , type = ty .Callable , hash_eq = True , default = func ),
2727 ]
2828 assert outputs == [python .out (name = "out" , type = float )]
2929 definition = SampleDef (a = 1 )
@@ -45,7 +45,7 @@ def func(a: int, k: float = 2.0) -> float:
4545 outputs = sorted (list_fields (SampleDef .Outputs ), key = sort_key )
4646 assert inputs == [
4747 python .arg (name = "a" , type = int ),
48- python .arg (name = "function" , type = ty .Callable , default = func ),
48+ python .arg (name = "function" , type = ty .Callable , hash_eq = True , default = func ),
4949 python .arg (name = "k" , type = float , default = 2.0 ),
5050 ]
5151 assert outputs == [python .out (name = "out" , type = float )]
@@ -69,7 +69,7 @@ def func(a: int) -> float:
6969 outputs = sorted (list_fields (SampleDef .Outputs ), key = sort_key )
7070 assert inputs == [
7171 python .arg (name = "a" , type = int , help = "The argument to be doubled" ),
72- python .arg (name = "function" , type = ty .Callable , default = func ),
72+ python .arg (name = "function" , type = ty .Callable , hash_eq = True , default = func ),
7373 ]
7474 assert outputs == [
7575 python .out (name = "b" , type = Decimal , help = "the doubled output" ),
@@ -94,7 +94,7 @@ def func(a: int) -> int:
9494 outputs = sorted (list_fields (SampleDef .Outputs ), key = sort_key )
9595 assert inputs == [
9696 python .arg (name = "a" , type = float ),
97- python .arg (name = "function" , type = ty .Callable , default = func ),
97+ python .arg (name = "function" , type = ty .Callable , hash_eq = True , default = func ),
9898 ]
9999 assert outputs == [python .out (name = "b" , type = float )]
100100 intf = SampleDef (a = 1 )
@@ -118,6 +118,7 @@ def SampleDef(a: int, b: float) -> tuple[float, float]:
118118 python .arg (
119119 name = "function" ,
120120 type = ty .Callable ,
121+ hash_eq = True ,
121122 default = attrs .fields (SampleDef ).function .default ,
122123 ),
123124 ]
@@ -149,6 +150,7 @@ def SampleDef(a: int, b: float) -> tuple[float, float]:
149150 python .arg (
150151 name = "function" ,
151152 type = ty .Callable ,
153+ hash_eq = True ,
152154 default = attrs .fields (SampleDef ).function .default ,
153155 ),
154156 ]
@@ -183,6 +185,7 @@ def SampleDef(a: int, b: float) -> tuple[float, float]:
183185 python .arg (
184186 name = "function" ,
185187 type = ty .Callable ,
188+ hash_eq = True ,
186189 default = attrs .fields (SampleDef ).function .default ,
187190 ),
188191 ]
@@ -225,6 +228,7 @@ def SampleDef(a: int, b: float) -> tuple[float, float]:
225228 python .arg (
226229 name = "function" ,
227230 type = ty .Callable ,
231+ hash_eq = True ,
228232 default = attrs .fields (SampleDef ).function .default ,
229233 ),
230234 ]
@@ -272,6 +276,7 @@ def function(a, b):
272276 python .arg (
273277 name = "function" ,
274278 type = ty .Callable ,
279+ hash_eq = True ,
275280 default = attrs .fields (SampleDef ).function .default ,
276281 ),
277282 ]
@@ -342,6 +347,7 @@ def function(a, b):
342347 python .arg (
343348 name = "function" ,
344349 type = ty .Callable ,
350+ hash_eq = True ,
345351 default = attrs .fields (SampleDef ).function .default ,
346352 ),
347353 ]
0 commit comments