Hi, I had been coding for a while and sometimes I see despite some parameter not being declared within a function of a class. Still, some developers use self method to call them. Can anyone explain me how it works?
As it’s visible above, sock was not called through init method but still we’re able to use self for sock Can someone help me with this problem? I’ll be really grateful ^^
The fact that sock was not supplied as a parameter in the __init__ header does not prevent its name from being added to the new Client instance to represent an instance variable.
Once that instance variable has been added, methods that are connected with its type can be called, and that is what happens here: