Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatfrozensetgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: staticmethod
Description
Transforms a method into a static method.
Extended Description
The staticmethod decorator is used to declare a method as a static method. Unlike regular methods, static methods don't receive an implicit first argument (usually named 'self' for instance methods or 'cls' for class methods). They can be called on the class or an instance of the class, but they don't have access to the instance or class through an implicit first parameter. Static methods are often used for utility functions that don't need to access or modify the class state.
Read More about staticmethod from Python Documentation
Function Signature
@staticmethod def function(*args, **kwargs) -> Any
Module: builtins
Class: staticmethod
Parameters
Parameter List
- function: Callable
Return
Returns a static method for the given function.
Return Type
staticmethod
Output
Explanation
This example shows how to define and use static methods in a class.