Can someone explain why you can’t use ‘this’ in a private method?
Or maybe I’m reading this wrong; it lists a private method and says “Does not work with the this. operator”?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My guess is that you are trying to use
thiswithin aprivate staticmethod. That is not allowed because:thisrefers to the target object, andstaticmethods have no notion of a target object.If that doesn’t help, then post a code snippet and the exact compilation error message / context.