pytest-mypy-plugins icon indicating copy to clipboard operation
pytest-mypy-plugins copied to clipboard

Add option to ignore `*` and `1 in types

Open sobolevn opened this issue 4 years ago • 2 comments

There are cases when some types are revealed like:

# N: Revealed type is 'builtins.bool*'

Or like so:

reveal_type(dekind(container))  # N: Revealed type is 'main.IO[def (_ValueType`1) -> _NewValueType`-1]'

Here are the problems with these two things:

  1. They can change! Sometimes if you use a different technique inside your type, you will loose this * while everything else will work the exact same way
  2. Different versions of python in different environments might produce different numeric results after
`

char in type vars.

So, I propose to add strict: false parameter to our test cases to ignore these chars (and possibly other things in the future).

sobolevn avatar Oct 20 '20 08:10 sobolevn

I like strict_assert: false more. And probably we would also need a command line flag: --mypy-strict-assert

sobolevn avatar Oct 20 '20 09:10 sobolevn

PR #55 might cover this use case, though in a different way. Thoughts?

brunns avatar Aug 09 '21 07:08 brunns