Return python def as it should be written in stub files
(method)
| 209 | |
| 210 | |
| 211 | def gen_stub_method_def(method): |
| 212 | """Return python def as it should be written in stub files""" |
| 213 | param = '' |
| 214 | method_name = method['def_name'] |
| 215 | for p in method['params']: |
| 216 | p_type = join([': ', str(p['type'])]) if 'type' in p else '' |
| 217 | default = join([' = ', str(p['default'])]) if 'default' in p else '' |
| 218 | param = join([param, p['param_name'], p_type, default, ', ']) |
| 219 | param = param[:-2] # delete the last ', ' |
| 220 | return_type = join([' -> ', method['return']]) if 'return' in method else '' |
| 221 | return join([method_name, parentheses(param), return_type]) |
| 222 | |
| 223 | |
| 224 | def gen_doc_method_def(method, is_indx=False, with_self=True): |
nothing calls this directly
no test coverage detected