From: Nathaniel S. <nj...@po...> - 2013-03-15 17:49:17
|
On 15 Mar 2013 16:50, "Todd" <tod...@gm...> wrote: > Within the axes constructor, the constructor would run through each of these modules and store them as attributes with the same name as the function and the function itself being the contents. At least if me understanding is correct, this would make them behave as methods (since they are already set up to take an axes instance as their first argument). This won't work as described - the function -> unbound method -> bound method magic only happens for attributes that aren't found in the object dict, when lookup falls back on the type dict. You'll want to inject the functions into the Axes type object, either via a metaclass constructor or just by hand after the type is created. -n |