Skip to content

Conversation

@curtisbucher
Copy link
Contributor

@curtisbucher curtisbucher commented Mar 30, 2020

We should be using .copy() to compare key, value pairs and ChainMap in line 257. Otherwise it does not properly check union behavior.
@brandtbucher

https://bugs.python.org/issue36144

Test in TestChainMap() line 257 did not properly check union behavior.
Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@brandtbucher
Copy link
Member

Ubuntu failure looks unrelated.

@aeros
Copy link
Contributor

aeros commented Mar 30, 2020

@brandtbucher

Ubuntu failure looks unrelated.

Yeah it's definitely unrelated, since it failed in the "Install Dependencies" stage. I'll close and re-open the PR to restart the CI checks.

(For some reason, GitHub Actions retains the old failing checks on the same commit, but should still prove that the failure was unrelated to the PR).

@aeros aeros closed this Mar 30, 2020
@aeros aeros reopened this Mar 30, 2020
Copy link
Contributor

@aeros aeros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @curtisbucher.

We should be using .copy() to compare key, value pairs and ChainMap in line 257. Otherwise it does not properly check union behavior.

Agreed; if it's the same object, the test doesn't work as intended. After cm3 |= pairs, even the following would pass:

self.assertEqual(cm3.maps, [cm3.maps[0] | dict(), *cm3.maps[1:]])

(which somewhat defeats the purpose of the test)

@gvanrossum gvanrossum merged commit 0c5ad54 into python:master Mar 30, 2020
@bedevere-bot
Copy link

@gvanrossum: Please replace # with GH- in the commit message next time. Thanks!

@curtisbucher curtisbucher deleted the chainmap584 branch May 5, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants