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

Method key

Lib/test/test_build_details.py:44–54  ·  view source on GitHub ↗

Helper to fetch subsection entries. It takes the entry name, allowing the usage of a dot to separate the different subsection names (eg. specifying 'a.b.c' as the key will return the value of self.data['a']['b']['c']).

(self, name)

Source from the content-addressed store, hash-verified

42 return json.loads(self.contents)
43
44 def key(self, name):
45 """Helper to fetch subsection entries.
46
47 It takes the entry name, allowing the usage of a dot to separate the
48 different subsection names (eg. specifying 'a.b.c' as the key will
49 return the value of self.data['a']['b']['c']).
50 """
51 value = self.data
52 for part in name.split('.'):
53 value = value[part]
54 return value
55
56 def test_top_level_container(self):
57 self.assertIsInstance(self.data, dict)

Callers 8

test_base_prefixMethod · 0.95
test_base_interpreterMethod · 0.95
test_platformMethod · 0.95
test_language_versionMethod · 0.95
test_implementationMethod · 0.95
test_base_interpreterMethod · 0.45
test_c_apiMethod · 0.45

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected