Timeline for answer to What is the difference between @staticmethod and @classmethod in Python? by Chris B.
Current License: CC BY-SA 3.0
Post Revisions
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 7, 2022 at 21:25 | comment | added | Hamidreza Hosseinkhani | You are wrong! "static members" in Java are equivalent to "class members" in Python (the difference is in Java you can access a public static attribute from an object but in Python, you can not). "static methods" in Java are equivalent to "classmethod" in Python that can access the class state (class members) "staticmethod" in Python is a relatively useless method that does not access the class state nor instance state and is like a pure function out of the class definition. | |
| May 15, 2020 at 1:54 | comment | added | Aaron Bentley | It may be a cut-and-paste error, but strictly speaking you can't call a method on a class if you ignore the class. | |
| Mar 2, 2020 at 15:33 | comment | added | mirek | Isn't there an error in docs? Shouldn't be at staticmethod: "The instance and its class are both ignored." instead of "The instance is ignored except for its class."? | |
| Mar 7, 2014 at 21:17 | review | Suggested edits | |||
| Mar 7, 2014 at 21:19 | |||||
| Dec 11, 2012 at 9:56 | history | edited | me_and | CC BY-SA 3.0 |
Update formatting to properly format code; other formatting improvements to match linked source
|
| Mar 1, 2011 at 5:15 | history | post merged (destination) | |||
| Nov 3, 2009 at 19:23 | history | answered | Chris B. | CC BY-SA 2.5 |