Trees | Index | Help |
---|
Package SPyRO :: Module args :: Class Arguments |
|
Check if the arguments are valid against |fmt_args|. If any constraint is not valid, the function will return raise a TypeError and will set the appropiate string in the raised Exception. If the number of the given arguments are lesser that supposed it will raise TypeError too A proper check of arguments inside functions can be performed using the function 'local()' to retrieve local variables. And get the retrieve arguments |fmt_args| is a collection of tuples (argument_name, argument_value) Example ( ('arg1',fmt_arg1), ('arg2',fmt_arg2), ('arg3',fmt_arg3), ... ) The arguments will be create two checking instances a list and a dictionary. The list checks positional arguments |args|, then when positional arguments are exhausted, named arguments |kwargs| will be checked with the dictionary validator.
Method Summary | |
---|---|
Compile an argument list to positional and keyword argument formats | |
Check arguments |
Class Variable Summary | |
---|---|
dict |
Types = {'c': <type 'complex'>, 'b': <type 'bool'>, 'd':...
|
Method Details |
---|
__init__(self,
fmt_args)
Compile an argument list to positional and keyword argument
formats
|
check(self, args=(), kwargs={})Check arguments |
Class Variable Details |
---|
Types
|
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 | http://epydoc.sf.net |