MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _size_of

Function _size_of

lib/core/bigarray.py:39–53  ·  view source on GitHub ↗

Returns total size of a given instance / object (in bytes)

(instance)

Source from the content-addressed store, hash-verified

37 STRING_TYPES = (str, bytes)
38
39def _size_of(instance):
40 """
41 Returns total size of a given instance / object (in bytes)
42 """
43
44 retval = sys.getsizeof(instance, DEFAULT_SIZE_OF)
45
46 if isinstance(instance, STRING_TYPES):
47 return retval
48 elif isinstance(instance, dict):
49 retval += sum(_size_of(_) for _ in itertools.chain.from_iterable(instance.items()))
50 elif isinstance(instance, (list, tuple, set, frozenset)):
51 retval += sum(_size_of(_) for _ in instance if _ is not instance)
52
53 return retval
54
55class Cache(object):
56 """

Callers 1

appendMethod · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…