Skip to content

Conversation

un-pogaz
Copy link

Fixes #18932

Adding a new setting "user_builtins_name" that allow to ignore specific "name-defined" errors.

This setting should be used only if new values have beed defined into the builtins module.

Example of user builtins name:

builtins.__dict__['prints'] = prints = PrefixedPrint()

The function prints can be used anywhere in the project without need to write the import. However, in such case mypy raise a error "name-defined", even if the code is valid. This PR allow to not raise this error. The setting can be defined per modules.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New setting "user_builtins_name": Ignore specific "name-defined" errors

1 participant