Getting rid of "self."
bjourne at gmail.com
Fri Jan 7 17:51:13 CET 2005
Thank you for your replies. But they don't deal with my original
question. :) I have read the thousands of posts all saying "self is
good" and they are right. But this time I want to be different m-kay?
I figure that there might be some way to solve my problem by doing
. # Do something magic here so that exec(magic()) is automagically
run each time
. # the function is invoked.
. newmethod = method
. return newmethod
And then in the class definition something like this:
. def __init__(self):
. self.hi = "hi"
. def meth(self):
. print hi
. meth = instancevar2locals(meth)
But beyond that, I have no idea and I would be grateful if someone
would like to help me with it.
More information about the Python-list