Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ C
Class
C
Lib/test/test_copy.py:32–36 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
30
31
def
test_copy_copy(self):
32
class
C(object):
33
def
__init__(self, foo):
34
self.foo = foo
35
def
__copy__(self):
36
return
C(self.foo)
37
x = C(42)
38
y = copy.copy(x)
39
self.assertEqual(y.__class__, x.__class__)
Callers
15
__copy__
Method · 0.70
test_copy_copy
Method · 0.70
test_copy_registry
Method · 0.70
test_copy_reduce_ex
Method · 0.70
test_copy_reduce
Method · 0.70
test_copy_cant
Method · 0.70
test_copy_inst_vanilla
Method · 0.70
test_copy_inst_copy
Method · 0.70
test_copy_inst_getinitargs
Method · 0.70
test_copy_inst_getnewargs
Method · 0.70
test_copy_inst_getnewargs_ex
Method · 0.70
test_copy_inst_getstate
Method · 0.70
Calls
no outgoing calls
Tested by
15
__copy__
Method · 0.56
test_copy_copy
Method · 0.56
test_copy_registry
Method · 0.56
test_copy_reduce_ex
Method · 0.56
test_copy_reduce
Method · 0.56
test_copy_cant
Method · 0.56
test_copy_inst_vanilla
Method · 0.56
test_copy_inst_copy
Method · 0.56
test_copy_inst_getinitargs
Method · 0.56
test_copy_inst_getnewargs
Method · 0.56
test_copy_inst_getnewargs_ex
Method · 0.56
test_copy_inst_getstate
Method · 0.56