Update class literal display to use <class 'Foo'> style#17889
Update class literal display to use <class 'Foo'> style#17889charliermarsh merged 4 commits intomainfrom
<class 'Foo'> style#17889Conversation
|
Want to make sure I'm on the right track before I update the remaining tests. |
|
AlexWaygood
left a comment
There was a problem hiding this comment.
This is looking great to me so far! Probably best to wait for at least one other person to give the thumbs up before proceeding further, though 😄
| | Type::GenericAlias(_) => { | ||
| write!(f, "Literal[{representation}]") | ||
| } |
There was a problem hiding this comment.
we probably want to make the same update for Type::GenericAlias
|
This is looking good to me as well! |
40216f3 to
77958c5
Compare
9796263 to
e69756f
Compare
| @@ -605,7 +604,6 @@ impl Display for DisplayLiteralGroup<'_> { | |||
| /// For example, `Literal[1] | Literal[2] | Literal["s"]` is displayed as `"Literal[1, 2, "s"]"`. | |||
| #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] | |||
| enum CondensedDisplayTypeKind { | |||
There was a problem hiding this comment.
I don't think we are going to add more of these, so I think we could remove this enum entirely and simplify the literal display code to not need to consider multiple "kinds" at all.
But I'm not going to hold up this PR for that, gonna land this quick before there are any conflicts.
There was a problem hiding this comment.
Cool I can do it as a follow-up.
|
Hmm I noticed after my review that all the CI checks were stuck in some kind of pending state; after closing and reopening to nudge the CI, it seems a few tests are still failing? |
|
Oh strange, I can fix. |
e69756f to
1de758a
Compare
|
|
## Summary See: #17889 (comment)
Summary
Closes #17238.