I'm still quite new at python, and I've looked in a book I got and searched here and on the web. But I'm not getting an answer that is down to the level I apparently can grasp atm.
I got 2 different class's.
main.py
import listManipulator as lm
lc = lm.listManipulator()
li = [some list]
li2 = [some other list]
li = lm.listManipulator.cleanupList(li) # This call method does not requires the method to have the self argument
li2 = lc.cleanupList(li2) # This call method requires the method to have the self argument
So I'm trying to call my cleanup method, and I'm getting confused by this self argument, yet again. I'ved figured out there are 2 ways calling the method as shown above.
listManipulator.py
class listManipulator:
def cleanupList(self, list):
*do stuff*
return list
As you can tell from the comments in the code, in one of the calls, I NEED the target method to have the self argument, but I don't in the other. Can anyone give me a down to earth explanation of why the frack this is?