lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Greetings!

Perhaps I should be asking this on a python list; but I imagine there are some people here with experience in both, which is what I really need.

Does anyone know if there is a way in Python to create some sort of function closures from the tp_getattro function?

Currently, in Lua, I am returning one function pointer with other information bound into a closure from my __index metamethod, in order to implement dynamic methods (ie, methods are not known at compile time, so I bind with a dispatcher function of sorts).

On first inspection, I can't see how this can easily be achieved in Python; any pointers would be appreciated.

Thanks!

Love, Light and Peace,
- Peter Loveday
eyeon Software