@@ -218,6 +218,43 @@ def bmethod(cls, number, lst):
218
218
self .assertEqual (props .argspec .args , ["number" , "lst" ])
219
219
self .assertEqual (props .argspec .defaults [0 ], [])
220
220
221
+ def test_issue_966_static_method (self ):
222
+ class Issue966 (Sequence ):
223
+ @staticmethod
224
+ def cmethod (number : int , lst : List [int ] = []):
225
+ """
226
+ Return a list of numbers
227
+
228
+ Example:
229
+ ========
230
+ C.cmethod(1337, [1, 2]) # => [1, 2, 1337]
231
+ """
232
+ return lst + [number ]
233
+
234
+ @staticmethod
235
+ def bmethod (number , lst ):
236
+ """
237
+ Return a list of numbers
238
+
239
+ Example:
240
+ ========
241
+ C.cmethod(1337, [1, 2]) # => [1, 2, 1337]
242
+ """
243
+ return lst + [number ]
244
+
245
+ props = inspection .getfuncprops (
246
+ "bmethod" , inspection .getattr_safe (Issue966 , "bmethod" )
247
+ )
248
+ self .assertEqual (props .func , "bmethod" )
249
+ self .assertEqual (props .argspec .args , ["number" , "lst" ])
250
+
251
+ props = inspection .getfuncprops (
252
+ "cmethod" , inspection .getattr_safe (Issue966 , "cmethod" )
253
+ )
254
+ self .assertEqual (props .func , "cmethod" )
255
+ self .assertEqual (props .argspec .args , ["number" , "lst" ])
256
+ self .assertEqual (props .argspec .defaults [0 ], [])
257
+
221
258
222
259
class A :
223
260
a = "a"
0 commit comments