Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 435 Bytes

useless-return.md

File metadata and controls

23 lines (15 loc) · 435 Bytes

Pattern: Useless return

Issue: -

Description

Emitted when a single return or return None statement is found at the end of function or method definition. This statement can safely be removed because Python will implicitly return None.

Example of incorrect code:

def test():
    print('---- testing ---')
    return

Example of correct code:

def test():
    print('---- testing ---')