Skip to content

UP008 should ignore shadowed super #18684

@dscorbett

Description

@dscorbett

Summary

super-call-with-parameters (UP008) should not apply when super isn’t the built-in super.

$ cat >up008.py <<'# EOF'
class C:
    def f(self):
        super = print
        super(C, self)
C().f()
# EOF

$ python up008.py
<class '__main__.C'> <__main__.C object at 0x104a1abd0>

$ ruff --isolated check up008.py --select UP008 --unsafe-fixes --fix
Found 1 error (1 fixed, 0 remaining).

$ python up008.py

Version

ruff 0.11.13 (5faf72a 2025-06-05)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixesRelated to suggested fixes for violationshelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions