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

Function copy_attributes

Lib/test/pythoninfo.py:48–56  ·  view source on GitHub ↗
(info_add, obj, name_fmt, attributes, *, formatter=None)

Source from the content-addressed store, hash-verified

46
47
48def copy_attributes(info_add, obj, name_fmt, attributes, *, formatter=None):
49 for attr in attributes:
50 value = getattr(obj, attr, None)
51 if value is None:
52 continue
53 name = name_fmt % attr
54 if formatter is not None:
55 value = formatter(attr, value)
56 info_add(name, value)
57
58
59def copy_attr(info_add, name, mod, attr_name):

Callers 15

collect_sysFunction · 0.85
collect_osFunction · 0.85
collect_readlineFunction · 0.85
collect_tkinterFunction · 0.85
collect_timeFunction · 0.85
collect_sslFunction · 0.85
collect_sqliteFunction · 0.85
collect_zlibFunction · 0.85
collect_zstdFunction · 0.85
collect_expatFunction · 0.85
collect_decimalFunction · 0.85
collect_test_socketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…