Skip to content

Files

Latest commit

 

History

History
30 lines (20 loc) · 623 Bytes

no-method-argument.md

File metadata and controls

30 lines (20 loc) · 623 Bytes

Pattern: Missing method argument

Issue: -

Description

Used when a method which should have the bound instance as first argument has no argument defined. Consider adding self parameter to such methods to resolve this issue.

Example of incorrect code:

class Felinae(object):
    def __init__(self, subfamily):
        self.subfamily = subfamily

    def hunt(): # [no-method-argument]
        print("hunting") 

Example of correct code:

class Felinae(object):
    def __init__(self, subfamily):
        self.subfamily = subfamily

    def hunt(self):
        print("hunting")