This script defines a decorator that allows for an abbreviated slice syntax in function arguments: {start:end}. Step is notsupported. Valid quickslices are dictionaries wintax in function arguments: {start:end}. Step is notsupported. Valid quickslices are dictionaries with a single integer key which has an integer value.

Arguments can be strings or integers, and indicate the positional or keyword arguments that should be checked for possible quickslices.

By default, no exception is raised if the indicated arguments turn out not to be quickslices (consider __getitem__, which can accept slices or integers). To change this behavior, set the keyword argument ‘argAssert’ to True.

The optional ‘argSearch’ keyword argument can be True or False, and specifies whether or not to check if every argument of the decorated function is a ‘quickslice’ rather than just the indicated arguments. The default is False.


Download from: Homepage




Author:
admin
Time:
Wednesday, June 25th, 2008 at 5:33 pm
Category:
Uncategorized
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation:

Leave a Reply