Use Literal type in io and _compression#6917
Use Literal type in io and _compression#6917JelleZijlstra merged 3 commits intopython:masterfrom sobolevn:patch-87
Literal type in io and _compression#6917Conversation
|
Just curious, what is your motivation for all these Literal changes? Is there a concrete use case this unlocks? |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Yes, I am working on better |
|
I saw that but I wasn't clear on the concrete use case there either. |
|
I can see myself staring at some code that works incorrectly with a chunk of data that is 10000 bytes long but fine with 5000 bytes, wondering what |
|
@JelleZijlstra I think that this is how typing should be 🙂 It is just happens right now that we don't use x = 1
reveal_type(x) # Literal[1]I think that what pyright does at the moment. |
|
There has been discussion of using literal arithmetic to type array operations (for the shape parameter). |
No description provided.