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

Method read_file

Lib/optparse.py:867–870  ·  view source on GitHub ↗
(self, filename, mode="careful")

Source from the content-addressed store, hash-verified

865 self._update(vars(mod), mode)
866
867 def read_file(self, filename, mode="careful"):
868 vars = {}
869 exec(open(filename).read(), vars)
870 self._update(vars, mode)
871
872 def ensure_value(self, attr, value):
873 if not hasattr(self, attr) or getattr(self, attr) is None:

Callers 9

fileConfigFunction · 0.45
parse_errorMethod · 0.45
test_fileMethod · 0.45
test_iterableMethod · 0.45
test_source_as_bytesMethod · 0.45

Calls 3

_updateMethod · 0.95
openFunction · 0.70
readMethod · 0.45

Tested by 8

parse_errorMethod · 0.36
test_fileMethod · 0.36
test_iterableMethod · 0.36
test_source_as_bytesMethod · 0.36