MCPcopy Index your code
hub / github.com/RustPython/RustPython / copy

Method copy

Lib/hmac.py:154–170  ·  view source on GitHub ↗

Return a separate copy of this hashing object. An update to this copy won't affect the original object.

(self)

Source from the content-addressed store, hash-verified

152 inst.update(msg)
153
154 def copy(self):
155 """Return a separate copy of this hashing object.
156
157 An update to this copy won't affect the original object.
158 """
159 # Call __new__ directly to avoid the expensive __init__.
160 other = self.__class__.__new__(self.__class__)
161 other.digest_size = self.digest_size
162 other.block_size = self.block_size
163 if self._hmac:
164 other._hmac = self._hmac.copy()
165 other._inner = other._outer = None
166 else:
167 other._hmac = None
168 other._inner = self._inner.copy()
169 other._outer = self._outer.copy()
170 return other
171
172 def _current(self):
173 """Return a hash object for the current state.

Callers 15

test_equalityMethod · 0.95
translationFunction · 0.45
_synthesizeFunction · 0.45
getmoduleFunction · 0.45
_signature_fromstrFunction · 0.45
_get_revised_pathFunction · 0.45
_find_keyword_typosMethod · 0.45
copyFunction · 0.45
__init__Method · 0.45
findMethod · 0.45
testfileFunction · 0.45

Calls 1

__new__Method · 0.45

Tested by 9

test_equalityMethod · 0.76
__init__Method · 0.36
findMethod · 0.36
testfileFunction · 0.36
setUpMethod · 0.36
DocFileTestFunction · 0.36
debug_scriptFunction · 0.36
run_via_cpythonFunction · 0.36
run_via_rustpythonFunction · 0.36