summaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/core/inputsplitter.py
diff options
context:
space:
mode:
authorAlexSm <[email protected]>2024-03-13 16:36:01 +0100
committerGitHub <[email protected]>2024-03-13 16:36:01 +0100
commit6cb1176da7acfe6571977f06e7d9dc4365cb330b (patch)
treec15fcf49a68ba829dc39eef237f94f41d0b55ee6 /contrib/python/ipython/py3/IPython/core/inputsplitter.py
parent67ba58b766f6ca63d5471aa18728e69d03ffe1ca (diff)
parent18c62b66fdaa3ae6c066f720f82b88b28cc3dc91 (diff)
Merge pull request #2697 from ydb-platform/mergelibs-240313-1032
Library import 240313-1032
Diffstat (limited to 'contrib/python/ipython/py3/IPython/core/inputsplitter.py')
-rw-r--r--contrib/python/ipython/py3/IPython/core/inputsplitter.py11
1 files changed, 7 insertions, 4 deletions
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