apply problems

William Park opengeometry at yahoo.ca
Fri Jul 13 20:12:29 CEST 2001


On Fri, Jul 13, 2001 at 10:50:57AM -0700, Curtis Jensen wrote:
> apply( self.ren.Elements, cmd[1], additional_kwds )

> def Elements( self, at, deformed, iact, normal, xi, nelist, nodes,
> elements, *args, **kwds ):

> However, if I replace the apply command with:
> self.ren.Elements( cmd[1][0], cmd[1][1], cmd[1][2], cmd[1][3],
> cmd[1][4], cmd[1][5], additional_kwds )
> 
> It works fine.  I can't figure why the apply line doesn't work.  There

Try
    apply( self.ren.Elements, (self, cmd[1]), additional_kwds )
There is subtle difference between calling Elements() as regular
function and as class method within an object, namely 'self' argument.

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8 CPUs cluster, (Slackware) Linux, Python, LaTeX, Vim, Mutt, Sc.




More information about the Python-list mailing list