Feature request: support `typing.reveal_type`

  • Operating system: Windows 11
  • SonarLint plugin version: v4.3.0
  • Programming language you’re coding in: Python
  • Is connected mode used: no

SonarLint does not seem to support typing.reveal_type, see typing — Support for type hints — Python 3.12.2 documentation

from typing import reveal_type

my_float = 1.0
reveal_type(my_float)
>mypy bug.py
bug.py:4: note: Revealed type is "builtins.float"

>pyright bug.py
bug.py:4:13 - information: Type of "my_float" is "float"

image

Hello @bers,

Thank you for your suggestion! To be honest, this is not something that was on our radar, as we generally try to focus on finding actual code issues rather than act purely as a type-checker.

However, seeing that this feature seems widely supported, I think it makes sense for us to consider it as well. I created the following ticket which we’ll discuss internally.

Cheers,
Guillaume