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

Method create_code

Lib/test/test_compileall.py:1026–1033  ·  view source on GitHub ↗
(self, docstring=False, assertion=False)

Source from the content-addressed store, hash-verified

1024 hardlink_dupes=True)
1025
1026 def create_code(self, docstring=False, assertion=False):
1027 lines = []
1028 if docstring:
1029 lines.append("'module docstring'")
1030 lines.append('x = 1')
1031 if assertion:
1032 lines.append("assert x == 1")
1033 return '\n'.join(lines)
1034
1035 def iter_codes(self):
1036 for docstring in (False, True):

Callers 4

iter_codesMethod · 0.95
test_only_two_levelsMethod · 0.95
test_importMethod · 0.95

Calls 2

appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected