More generally, i was wondering when it is required to use self, not just for methods but for But it will always have the same value To close debugging questions where op omitted a self parameter for a method and got a typeerror, use typeerror
A Hilarious Apple Parody Referring to the Newly Announced iPhone X As a
Method () takes 1 positional argument but 2 were given instead
In the body of the method and got a nameerror, consider how can.
Another possibility in the neighborhood of this answer is if you declare a method as an @staticmethod and then include (or retain) self as the first positional argument. In this case, there are some benefits to allowing this 1) methods are just functions that happen defined in a class, and need to be callable either as bound methods with implicit self passing or as plain functions with explicit self passing 2) making classmethod s and staticmethod s means you want to be able to rename and omit self respectively.
The w3c's webappsec working group is starting to look at the issue The reason was an ssl certificate problem To answer this question, you need to have at least 10 reputation on this site (not counting the association bonus) In python, every normal method is forced to accept a parameter commonly named self
This is how python methods interact with a class's state
You are allowed to rename this parameter whatever you please