KotlinIsland / KotlinIsland/basedmypy
Render `Any` subtypes
Open
Nobody has claimed this yet.
feature
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
class A(Any): ...
reveal_type(A()) # A
This could reveal something like A(Any) or Any(A) or Any[A]
class A:
def __getattr__(...) -> Any: ...
a: A
reveal_type(a.foo) # Any
This could mention that the signature of foo is actually comming from an operator.
Original Content
import tempfile
from os import PathLike
with tempfile.NamedTemporaryFile() as file:
reveal_type(file) # tempfile._TemporaryFileWrapper[builtins.bytes]
foo: PathLike[str] = file # no error even though it's not a PathLike
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the issue's reveal_type examples and the original PathLike[str] assignment case. Trace how the checker represents Any in subtype declarations and __getattr__ results, then determine the intended output for each example. Done means the proposed representation and behavior are specified and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100