Follow up for #283 (response to comments) including change in Union[X, Any] by ilevkivskyi · Pull Request #288 · python/typing
-
Notifications
You must be signed in to change notification settings - Fork 299
Conversation
Fixes #285
@gvanrossum Please take a look.
Later I will make a PR to python/peps and will submit a documentation patch to b.p.o.
| u = Union[int, Any] | ||
| self.assertEqual(u, Any) | ||
| u = Union[Any, int] | ||
| self.assertEqual(u, Any) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep the test but change the asserts to test for the new behavior?
|
|
||
| - Similar for object:: | ||
|
|
||
| Union[int, object] == object |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep this even though it's not a special case -- it's a nice edge case that confirms the rule.
@gvanrossum I agree with both points. Implemented this in a new commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters