Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

avoid self python by making class functions static

class A(object):

    @staticmethod
    def stat_meth():
        print("Look no self was passed")
>>> a = A()
>>> a.stat_meth()
Look no self was passed
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #avoid #python #making #class #functions #static
ADD COMMENT
Topic
Name
7+5 =