[IronPython] __getattr__ overflow
ionrock at gmail.com
Mon Sep 18 18:28:31 CEST 2006
I was trying to wrap a rather verbose library to something more concise.
Essentially, I have a module with a bunch of static functions and I wanted
to create an object that automatically adds a prefix to the function calls.
Would be like:
In CPython I could do something like this:
def __getattr__(self, method):
prefix_method = "F_ApiPrefix" + method
c = wrap()
This returns the right thing.
In IronPython it gives a buffer overflow. I have posted the following code I
used to test this out.
>>> class C:
... def __getattr__(self, var):
... pre_name = "say_" + str(var)
... return self.pre_name
... def hello(self, name):
... print "Hello %s!" % name
>>> c = C()
Sorry if this has already been posted/reported. I took a quick glance at the
codeplex database, but I didn't know if it was the same issue reported for
other __getattr__ bugs.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users