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

Method __post_init__

Lib/_pyrepl/reader.py:265–281  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263 last_refresh_cache: RefreshCache = field(default_factory=RefreshCache)
264
265 def __post_init__(self) -> None:
266 # Enable the use of `insert` without a `prepare` call - necessary to
267 # facilitate the tab completion hack implemented for
268 # <https://bugs.python.org/issue25660>.
269 self.keymap = self.collect_keymap()
270 self.input_trans = input.KeymapTranslator(
271 self.keymap, invalid_cls="invalid-key", character_cls="self-insert"
272 )
273 self.screeninfo = [(0, [])]
274 self.cxy = self.pos2xy()
275 self.lxy = (self.pos, 0)
276 self.can_colorize = _colorize.can_colorize()
277
278 self.last_refresh_cache.screeninfo = self.screeninfo
279 self.last_refresh_cache.pos = self.pos
280 self.last_refresh_cache.cxy = self.cxy
281 self.last_refresh_cache.dimensions = (0, 0)
282
283 def collect_keymap(self) -> tuple[tuple[KeySpec, CommandName], ...]:
284 return default_keymap

Callers

nothing calls this directly

Calls 2

collect_keymapMethod · 0.95
pos2xyMethod · 0.95

Tested by

no test coverage detected