MCPcopy Index your code
hub / github.com/RustPython/RustPython / __post_init__

Method __post_init__

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

Source from the content-addressed store, hash-verified

300 last_refresh_cache: RefreshCache = field(default_factory=RefreshCache)
301
302 def __post_init__(self) -> None:
303 # Enable the use of `insert` without a `prepare` call - necessary to
304 # facilitate the tab completion hack implemented for
305 # <https://bugs.python.org/issue25660>.
306 self.keymap = self.collect_keymap()
307 self.input_trans = input.KeymapTranslator(
308 self.keymap, invalid_cls="invalid-key", character_cls="self-insert"
309 )
310 self.screeninfo = [(0, [])]
311 self.cxy = self.pos2xy()
312 self.lxy = (self.pos, 0)
313 self.can_colorize = can_colorize()
314
315 self.last_refresh_cache.screeninfo = self.screeninfo
316 self.last_refresh_cache.pos = self.pos
317 self.last_refresh_cache.cxy = self.cxy
318 self.last_refresh_cache.dimensions = (0, 0)
319
320 def collect_keymap(self) -> tuple[tuple[KeySpec, CommandName], ...]:
321 return default_keymap

Callers

nothing calls this directly

Calls 3

collect_keymapMethod · 0.95
pos2xyMethod · 0.95
can_colorizeFunction · 0.90

Tested by

no test coverage detected