Clarifying appropriate use cases for Literal types in the guides #2149
u-harshitha007
started this conversation in
General
Replies: 1 comment
-
|
Which typing guides do you refer to specifically? In general, our documentation is very spotty, though, and we're missing a proper tutorial. Any PRs to improve the situation are welcome. The Typing Python Libraries guide has a very brief section about literals, that could probably be extended, or point to general guidance in another document. Apart from that I mostly find references in the typing spec, which is not intended for end users. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While reading the typing guides, I noticed that Literal types are introduced,
but there isn’t much guidance on when they should or should not be used.
New users often try to apply Literal to dynamic values or user input,
which doesn’t provide useful guarantees and can lead to confusion
when using type checkers.
Would it be acceptable to add a short, non-normative note in the guides
clarifying appropriate use cases for Literal types?
Beta Was this translation helpful? Give feedback.
All reactions