File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,9 @@ def getpydocspec(f, func):
203203 varkwargs = arg [2 :]
204204 elif arg .startswith ("*" ):
205205 varargs = arg [1 :]
206+ elif arg == "..." :
207+ # At least print denotes "..." as separator between varargs and kwonly args.
208+ varargs = ""
206209 else :
207210 arg , _ , default = arg .partition ("=" )
208211 if varargs is not None :
Original file line number Diff line number Diff line change @@ -118,6 +118,17 @@ def test_get_source_file(self):
118118 )
119119 self .assertEqual (encoding , "utf-8" )
120120
121+ def test_getfuncprops_print (self ):
122+ props = inspection .getfuncprops ("print" , print )
123+
124+ self .assertEqual (props .func , "print" )
125+ self .assertIn ("end" , props .argspec .kwonly )
126+ self .assertIn ("file" , props .argspec .kwonly )
127+ self .assertIn ("flush" , props .argspec .kwonly )
128+ self .assertIn ("sep" , props .argspec .kwonly )
129+ self .assertEqual (props .argspec .kwonly_defaults ["file" ], "sys.stdout" )
130+ self .assertEqual (props .argspec .kwonly_defaults ["flush" ], "False" )
131+
121132 @unittest .skipUnless (numpy is not None , "requires numpy" )
122133 def test_getfuncprops_numpy_array (self ):
123134 props = inspection .getfuncprops ("array" , numpy .array )
You can’t perform that action at this time.
0 commit comments