From e84602b8f2b95d10d45eb11369ae7d627339c881 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Tue, 12 Mar 2024 17:24:47 +0300 Subject: Intermediate changes --- contrib/python/ipython/py3/IPython/core/inputsplitter.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'contrib/python/ipython/py3/IPython/core/inputsplitter.py') diff --git a/contrib/python/ipython/py3/IPython/core/inputsplitter.py b/contrib/python/ipython/py3/IPython/core/inputsplitter.py index 33ed563221b..f1ebd96b69c 100644 --- a/contrib/python/ipython/py3/IPython/core/inputsplitter.py +++ b/contrib/python/ipython/py3/IPython/core/inputsplitter.py @@ -15,6 +15,7 @@ and stores the results. For more details, see the class docstrings below. """ +from __future__ import annotations from warnings import warn @@ -31,7 +32,7 @@ import sys import tokenize import warnings -from typing import List, Tuple, Union, Optional +from typing import List, Tuple, Union, Optional, TYPE_CHECKING from types import CodeType from IPython.core.inputtransformer import (leading_indent, @@ -52,6 +53,8 @@ from IPython.core.inputtransformer import (ESC_SHELL, ESC_SH_CAP, ESC_HELP, ESC_HELP2, ESC_MAGIC, ESC_MAGIC2, ESC_QUOTE, ESC_QUOTE2, ESC_PAREN, ESC_SEQUENCES) +if TYPE_CHECKING: + from typing_extensions import Self #----------------------------------------------------------------------------- # Utilities #----------------------------------------------------------------------------- @@ -637,9 +640,9 @@ class IPythonInputSplitter(InputSplitter): # Nothing that calls reset() expects to handle transformer # errors pass - - def flush_transformers(self): - def _flush(transform, outs): + + def flush_transformers(self: Self): + def _flush(transform, outs: List[str]): """yield transformed lines always strings, never None -- cgit v1.3