0

Hello I get the self required error bellow but when I try to make an instants of the class I get a 'ClassInstant Name' is not defined error. My code is huge so I can't post it here actually but my 'Class Functons Collings' (ClassInstant.Functions) are used in the class in init function. I really don't know what to doo pleas help! THANKS

MY ERROR is: TypeError: a_functin_in_class() missing 1 required positional argument: 'self'

AFTER INSTANT: NameError: name 'class instant' is not defined

  • https://stackoverflow.com/help/how-to-ask, https://stackoverflow.com/help/minimal-reproducible-example – Reti43 Nov 25 '21 at 16:12
  • You will also get to debug a lot of your programs if you google the exact error you get. Top result from a search brings you to another [SO question](https://stackoverflow.com/questions/17534345/typeerror-missing-1-required-positional-argument-self). – Reti43 Nov 25 '21 at 16:13
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 30 '21 at 13:38

1 Answers1

0

oh so it turns out I was trying to call the functions by classname.function but self.function was the correct use inside the class or __init__ I mean in my case this was the solution another solution I have found before this was using lambda and pass the self argument --> lambda: function(self) but I don't think that this is the best way for it I believe that self.function is better.