◐ Shell
clean mode source ↗

Follow up for #283 (response to comments) including change in Union[X, Any] by ilevkivskyi · Pull Request #288 · python/typing

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@ilevkivskyi

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.

gvanrossum

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.

@ilevkivskyi

@gvanrossum I agree with both points. Implemented this in a new commit.

2 participants

@ilevkivskyi @gvanrossum