Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Max Derkachev
John Machin wrote: > >>> A.foo > 123 Oh, I've been a little dumb to forget about it :) Thanks. Max. -- http://mail.python.org/mailman/listinfo/python-list

Adding new methods to new-style classes dynamically

2005-05-05 Thread Max Derkachev
Good day to all. Some time ago I'd been playing with a framework which uses dynamic class creation havily. Say, I could do: class A: pass # I method name is dynamic meth_name = 'foo' #method code can also be dynamic - any executable object will be good enough func = lambda self: self.__clas

Re: logging as root using python script

2005-04-07 Thread max . derkachev
Unixish system won't let You execute a setuid script with the setuid privileges. Only real machine code can be executed so. But of course, there are workarounds. When, say, you have a perl script with setuid bit set, and sperl (setuid root perl) is installed, the perl interpreter choses sperl to i