-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: format multiple CSS selectors correctly #39942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Anyone know how to correctly define a
|
you mean like |
to get this function to work nicely with
which needed either
|
can u make a data class instead? |
@simonjayhawkins any suggestions here |
68ede67
to
2212ff6
Compare
OK I reformatted and ignored the structure, just used @jreback this is greenish now for review |
we should only use a cast if know better than mypy or it is a false positive. can you add a comment in the code, about why we can guarantee that the list comprehension has 4 for statements. If this is refactored, does that help mypy? |
Thats why I tried to incorporate the TypedDict to make it clearer previously:
But didn't work for some of the 3.7builds which didn't have so I reverted to
But I know that in the case of the |
in the code we have the aliases...
so without from https://github.com/microsoft/pyright/blob/master/docs/typed-libraries.md
so if we can't use |
@simonjayhawkins I investigated the And then I considered the named tuple, and again from memory I think this faced exactly the same issue. I'm tempted to fix this very trivially, in the future, with the I understand he point about the aliases that exist in the code and helping future readers, but two months ago there wasn't any typing for these and a mismatch of patterns across the module (but it is improving) , so I'm keen just to code comment it for now. :) |
if that's the case, then indeed we can't change that.
code comment is fine |
looks fine. ping on green. |
@jreback ping all green. |
thanks @attack68 |
Fixes a bug that doesn't format multiple CSS elements in selectors properly.