MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _inspect_func_args

Function _inspect_func_args

lib/sqlalchemy/util/langhelpers.py:403–420  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

401
402
403def _inspect_func_args(fn):
404 try:
405 co_varkeywords = inspect.CO_VARKEYWORDS
406 except AttributeError:
407 # https://docs.python.org/3/library/inspect.html
408 # The flags are specific to CPython, and may not be defined in other
409 # Python implementations. Furthermore, the flags are an implementation
410 # detail, and can be removed or deprecated in future Python releases.
411 spec = compat.inspect_getfullargspec(fn)
412 return spec[0], bool(spec[2])
413 else:
414 # use fn.__code__ plus flags to reduce method call overhead
415 co = fn.__code__
416 nargs = co.co_argcount
417 return (
418 list(co.co_varnames[:nargs]),
419 bool(co.co_flags & co_varkeywords),
420 )
421
422
423@overload

Callers 1

get_cls_kwargsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected