MCPcopy Create free account
hub / github.com/bterwijn/memory_graph / My_Class

Class My_Class

images/copy_method.py:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import copy
7
8class My_Class:
9
10 def __init__(self):
11 self.digits = [1, 2]
12 self.letters = ['x', 'y']
13
14 def custom_copy(self):
15 """ Copies 'digits' but shares 'letters'. """
16 c = copy.copy(self)
17 c.digits = copy.copy(self.digits)
18 return c
19
20a = My_Class()
21b = a.custom_copy()

Callers 1

copy_method.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected