|
Panda3D
|
Public Member Functions | |
| __init__ (self, name) | |
| generic_func (self, *args, **kw) | |
Public Attributes | |
| name = name | |
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``.
| __init__ | ( | self, | |
| name ) |
| 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.
| name = name |