Given a filename provided by remember_bpython_input, returns the associated source string.
(self, key: str)
| 19 | return isinstance(fname, str) and fname.startswith("<bpython-input-") |
| 20 | |
| 21 | def get_bpython_history(self, key: str) -> tuple[int, None, list[str], str]: |
| 22 | """Given a filename provided by remember_bpython_input, |
| 23 | returns the associated source string.""" |
| 24 | try: |
| 25 | idx = int(key.split("-")[2][:-1]) |
| 26 | return self.bpython_history[idx] |
| 27 | except (IndexError, ValueError): |
| 28 | raise KeyError |
| 29 | |
| 30 | def remember_bpython_input(self, source: str) -> str: |
| 31 | """Remembers a string of source code, and returns |
no outgoing calls
no test coverage detected