Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
func_closure Class Reference

Public Member Functions

 __init__ (self, name)
 
 generic_func (self, *args, **kw)
 

Public Attributes

 name
 

Detailed Description

 This class is used to create a closure on the function name,
and also allows the ``*args, **kw`` syntax.  In Python, the lambda
syntax, used with default parameters, is used more often to create
a closure (that is, a binding of one or more variables into a
callable object), but that syntax doesn't work with ``**kw``.
Fortunately, a class method is also a form of a closure, because
it binds self; and this doesn't have any syntax problems with
``**kw``. 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
name )

Member Function Documentation

◆ generic_func()

generic_func ( self,
* args,
** kw )
 This method is bound to all the functions that might be
called from the pdef file.  It's a special function; when it is
called, it does nothing but store its name and arguments in the
caller's local scope, where they can be pulled out later. 

Member Data Documentation

◆ name

name