As in the title I want to know how to have a self instance in a staticmethod in python.
-
1use global keyword I suppose, but I do no think you want to do what your asking...there is a better wayeat_a_lemon– eat_a_lemon2011-04-20 20:33:47 +00:00Commented Apr 20, 2011 at 20:33
-
Why don't you tell us what the problem you're trying to solve is (with code) and we'll suggest something better than using static methods, which are rarely a good idea in Python.nmichaels– nmichaels2011-04-20 20:34:54 +00:00Commented Apr 20, 2011 at 20:34
-
can you guys see the second answer on this question stackoverflow.com/questions/5642500/…Wazery– Wazery2011-04-20 20:36:25 +00:00Commented Apr 20, 2011 at 20:36
-
because updating variables in a function as a side effect leads to bugs. Unless you have to like in C where your dealing directly with memoryeat_a_lemon– eat_a_lemon2011-04-20 20:39:25 +00:00Commented Apr 20, 2011 at 20:39
-
1I put an answer on your bountyeat_a_lemon– eat_a_lemon2011-04-20 21:05:27 +00:00Commented Apr 20, 2011 at 21:05
|
Show 3 more comments