MCPcopy Index your code
hub / github.com/python/cpython / copy

Method copy

Lib/hmac.py:166–182  ·  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

164 inst.update(msg)
165
166 def copy(self):
167 """Return a separate copy of this hashing object.
168
169 An update to this copy won't affect the original object.
170 """
171 # Call __new__ directly to avoid the expensive __init__.
172 other = self.__class__.__new__(self.__class__)
173 other.digest_size = self.digest_size
174 other.block_size = self.block_size
175 if self._hmac:
176 other._hmac = self._hmac.copy()
177 other._inner = other._outer = None
178 else:
179 other._hmac = None
180 other._inner = self._inner.copy()
181 other._outer = self._outer.copy()
182 return other
183
184 def _current(self):
185 """Return a hash object for the current state.

Callers 15

test_equalityMethod · 0.95
runFunction · 0.45
gradle_taskFunction · 0.45
runFunction · 0.45
create_xcframeworkFunction · 0.45
xcode_testFunction · 0.45
translationFunction · 0.45
_synthesizeFunction · 0.45
getmoduleFunction · 0.45
_signature_fromstrFunction · 0.45

Calls 1

__new__Method · 0.45

Tested by 7

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