KEMBAR78
disallow_subclassing_any should be configurable per-module · Issue #3800 · python/mypy · GitHub
Skip to content

disallow_subclassing_any should be configurable per-module #3800

@OddBloke

Description

@OddBloke

I have a codebase that is annotated where I'm introducing an integration with an another project. This integration takes the form of subclassing a super-class from their codebase.

I don't want to allow subclassing of Any for my entire codebase, I really would like to just allow it for this specific module.

(Specifically, when I add the following to setup.cfg:

[mypy-jenkins_job_linter.jjb_subcommand]
disallow_subclassing_any = False

I see this in the output:

setup.cfg: [mypy-jenkins_job_linter.jjb_subcommand]: Per-module sections should only specify per-module flags (disallow_subclassing_any)
...
jenkins_job_linter/jjb_subcommand.py:14: error: Class cannot subclass 'TestSubCommand' (has type 'Any')

)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions