diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 4873be6..e3351ed 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1362,9 +1362,9 @@ def match_dict_keys( # All checks passed! return True - filtered_key_is_final: Dict[Union[str, bytes, int, float], _DictKeyState] = ( - defaultdict(lambda: _DictKeyState.BASELINE) - ) + filtered_key_is_final: Dict[ + Union[str, bytes, int, float], _DictKeyState + ] = defaultdict(lambda: _DictKeyState.BASELINE) for k in keys: # If at least one of the matches is not final, mark as undetermined. diff --git a/IPython/core/guarded_eval.py b/IPython/core/guarded_eval.py index 628fe2f..39fe853 100644 --- a/IPython/core/guarded_eval.py +++ b/IPython/core/guarded_eval.py @@ -44,17 +44,20 @@ else: @undoc class HasGetItem(Protocol): - def __getitem__(self, key) -> None: ... + def __getitem__(self, key) -> None: + ... @undoc class InstancesHaveGetItem(Protocol): - def __call__(self, *args, **kwargs) -> HasGetItem: ... + def __call__(self, *args, **kwargs) -> HasGetItem: + ... @undoc class HasGetAttr(Protocol): - def __getattr__(self, key) -> None: ... + def __getattr__(self, key) -> None: + ... @undoc @@ -326,9 +329,9 @@ class EvaluationContext(NamedTuple): #: Global namespace globals: dict #: Evaluation policy identifier - evaluation: Literal["forbidden", "minimal", "limited", "unsafe", "dangerous"] = ( - "forbidden" - ) + evaluation: Literal[ + "forbidden", "minimal", "limited", "unsafe", "dangerous" + ] = "forbidden" #: Whether the evaluation of code takes place inside of a subscript. #: Useful for evaluating ``:-1, 'col'`` in ``df[:-1, 'col']``. in_subscript: bool = False diff --git a/IPython/core/tests/test_formatters.py b/IPython/core/tests/test_formatters.py index 5f8eeda..cd8c83e 100644 --- a/IPython/core/tests/test_formatters.py +++ b/IPython/core/tests/test_formatters.py @@ -535,7 +535,8 @@ def test_custom_repr_namedtuple_partialmethod(): from functools import partialmethod from typing import NamedTuple - class Foo(NamedTuple): ... + class Foo(NamedTuple): + ... Foo.__repr__ = partialmethod(lambda obj: "Hello World") foo = Foo()