Skip to content

Make sure copy and deepcopy are returning same class #460

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

Merged
merged 3 commits into from
Aug 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,13 @@ class Node(Generic[T]): ...
for t in things + [Any]:
self.assertEqual(t, copy(t))
self.assertEqual(t, deepcopy(t))
if sys.version_info >= (3, 3):
Copy link
Member

Choose a reason for hiding this comment

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

Could you please add a comment here explaining why we need this?

# From copy module documentation:
# It does "copy" functions and classes (shallow and deeply), by returning
# the original object unchanged; this is compatible with the way these
# are treated by the pickle module.
self.assertTrue(t is copy(t))
self.assertTrue(t is deepcopy(t))

def test_weakref_all(self):
T = TypeVar('T')
Expand Down