Return the function arguments as a single list along with the index within that list for a specified argument name. This function parses the args, kargs and signature looking for the location of *argname*, and returns a list containing all arguments, along with the argument location
(func, argname, args, kwargs)
| 2998 | |
| 2999 | |
| 3000 | def arg_location(func, argname, args, kwargs): |
| 3001 | """Return the function arguments as a single list along with the |
| 3002 | index within that list for a specified argument name. |
| 3003 | |
| 3004 | This function parses the args, kargs and signature looking for the |
| 3005 | location of *argname*, and returns a list containing all arguments, along |
| 3006 | with the argument location in that list. |
| 3007 | |
| 3008 | Args: |
| 3009 | |
| 3010 | func (function): The function to examine (usually the function |
| 3011 | that is wrapped). |
| 3012 | |
| 3013 | argname (:obj:`str`): The argument name to locate. |
| 3014 | |
| 3015 | args (:obj:`tuple`): The positional arguments. |
| 3016 | |
| 3017 | kwargs (:obj:`dict`): The keyword arguments. |
| 3018 | |
| 3019 | Returns: |
| 3020 | |
| 3021 | :obj:`tuple`: A tuple containing the list of all argument values along |
| 3022 | with the index for location of *argname*. |
| 3023 | |
| 3024 | """ |
| 3025 | if version_info > (3,): |
| 3026 | _arg_location = _arg_location3 |
| 3027 | else: |
| 3028 | _arg_location = _arg_location2 |
| 3029 | |
| 3030 | return _arg_location(func, argname, args, kwargs) |
| 3031 | |
| 3032 | |
| 3033 | def psafilepath(): |
no outgoing calls
no test coverage detected