Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Oct 31, 2024
1 parent 912098e commit 209f369
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions IPython/core/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,9 +1362,9 @@ def filter_prefix_tuple(key):
# 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.
Expand Down
15 changes: 9 additions & 6 deletions IPython/core/guarded_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@

@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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion IPython/core/tests/test_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 209f369

Please sign in to comment.