Skip to content

Overlapping entries in mypy.ini are processed in nondeterministic order #3675

Closed
@gvanrossum

Description

@gvanrossum

Suppose you have these entries in mypy.ini:

[mypy-metaserver.lib.shared_folder.*]
ignore_errors = True
[mypy-metaserver.lib.shared_folder.perms.*]
ignore_errors = False

For a submodule of package metaserver.lib.shared_folder.perms it will be nondeterministic whether that file is processed with ignore_errors = True or ignore_errors = False.

The reason is that Options.clone_for_module() in mypy/options.py loops over self.per_module_options which is a dict, and dict ordering is randomized by default in Python 3 (unless PYTHONHASHSEED is set).

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