Eric Firing <efiring@...229...> writes:
The current pyplot wrappers all have an argspec of (*args, **kwargs),
which means that any interactive tools that show the possible arguments
It is in some ways a separate change, but it would be nice if the
boilerplate were generated at build time, and/or generated as a separate
file from which pyplot.py would import everything. I don't like having
a single file that is partly hand-edited and partly machine-generated.
You're right, it would be better to generate it at build time. One
problem with this is that my version of boilerplate.py needs to import
axes.py to access the methods of the Axes class, and axes.py in turn
imports other things, making it impossible to run boilerplate.py without
having compiled the compilable modules. That's why I munge sys.path
before importing axes -- and there are lots of things that could go
wrong with that.
I guess a more correct approach would be to use something like the
parser module to read axes.py without executing the code.
Since we only support Python >=2.4 now, we could get rid of the whole
boilerplate code system and replace it with something more dynamic as
but I don't see any way of keeping the wrapped function's argspec
without doing something much like what we do now.
Have you looked at the decorator module?
That looks like it could work -- the memoize example seems to be pretty
close to our wrapping needs. I'll spend some time thinking about this
later. Thanks for the link!
Jouni K. Sepp�nen