Skip to content

Conversation

@StefanVK
Copy link

In cheat sheet added import of reveal_type used in sample code

Also removed unused imports Union and Optional.

This is a tiny change but I was confused about where reveal_type was coming from and had to google it, so I figure it could be easier to understand for somebody else, too.

In cheat sheet added import of reveal_type used in sample code
@StefanVK
Copy link
Author

I actually misunderstood this. reveal_type as imported from typing also exists and does print the runtime type.
What's meant here is adding reveal_type(x) to the code, running mypy on it and mypy will print the type it tracked for the variable. mypy does not require import reveal_type from typing and adding the import may further confuse the point.

So I'm dropping this pull request.

@StefanVK StefanVK closed this Dec 11, 2024
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.

1 participant