summaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/core/inputsplitter.py
diff options
context:
space:
mode:
authorAlexander Smirnov <[email protected]>2024-03-13 10:33:47 +0000
committerAlexander Smirnov <[email protected]>2024-03-13 10:33:47 +0000
commit1df54be5538361db7f33afc618d1597272414294 (patch)
treebb39e4b75db0b0a9722468eacef91ffd1388eb8d /contrib/python/ipython/py3/IPython/core/inputsplitter.py
parent7a673cf01feefbe95bf5e7396d9179a5f283aeba (diff)
parent01aef806626b16e9817e07f718f10e151f52e400 (diff)
Merge branch 'rightlib' into mergelibs-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