Conversation
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Yeah, that discussion isn't great. Note that mypy-primer doesn't tell you much here because mypy doesn't meaningfully support LiteralString. |
I want to understand what was misunderstood. Was it about the intent of LiteralString? because for me, LiteralString should work as explained in PEP-675 and if type checkers aren't able to follow the specs, it's not really the problem of the user (semantically it's even wrong to mandate that something being literal is passed if the quantity can be dynamically determined). AFAIK, the following should be wrong right? (but AFAIU, not flagged by mypy because it's not implemented) The discussion on DPO, while not very great, still tells me that we shouldn't try breaking user's code. I would be annoyed if I needed to change call sites or adding |
|
I've set off an ecosystem run for ty that cherry-picks this change into ty's vendored stubs, so we can see the ecosystem impact with a type checker that supports |
Cf. https://discuss.python.org/t/should-json-restrict-string-indentation-to-json-whitespace/109060
Edit: If you read through the discussion, there seems to be a lot of arguments based on a misunderstanding about how
LiteralStringworks. Please keep that in mind.