Finding the value passed to a function b

Category: Python - Education

Sometimes inside a decorator that creates a function with a generic (*args, **kwargs) signature, you want to access a value passed for a particular parameter name to a wrapped function, but don't know whether that value will be passed as a positional or keyword argument, or whether the wrapped function defines a default value for the parameter. This script contains an utility function that extracts this information for you. This function is meant to be used inside decorators, when you want to find what value will be available inside a wrapped function for a particular argument name. It handles positional and keyword arguments and takes into account default values. Date: 24 January, 2012


Function Value Finder - Function Wrapper - Function Argument - Function - Value - Finder

Homepage: http://code.activestate.com/

Developer: code.activestate.com

License: Freeware

Operating System: All

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

Sometimes inside a decorator that creates a function with a generic (*args, **kwargs) signature, you want to access a value passed for a particular parameter name to a wrapped function, but don't know whether that value will be passed as a positional or keyword argument, or whether the wrapped function defines a default value for the parameter.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows, Linux, Mac OS, BSD, Solaris


This class wraps most of the win32api functions for accessing a registry.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This class wraps most of the win32api functions for accessing a registry.

developer Developer: code.activestate.com
license License: Artistic License, GNU General Public License (GPL)
operating systems Operating System: Windows


This script presents you the tools for easy and stable recursion of current function when only selected arguments have to be changed.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Gamify class can help you to implement game logic to your PHP aplications or websites.

developer Developer: Arturs Sosins
license License: BSD License
operating systems Operating System: Not Available


This script can generate random password strings of any desired length, the main part is a re-usable JavaScript function which takes the password length as an argument and returns a random password string.

developer Developer: Stephen Griffin
license License: Freeware
operating systems Operating System: Linux


LastXgraph() is multi-platform compatible.

developer Developer: James Heinrich
license License: Freeware
operating systems Operating System: Unix/Linux/Windows


Proxy Example script demonstrates how to build a proxy object.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


This script is a useful wrapper around the python command line shell to allow editing of the last typed in lines of code in an external editor.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All