Skip to content

Commit 912098e

Browse files
committed
reformat
1 parent c8d9469 commit 912098e

File tree

11 files changed

+42
-36
lines changed

11 files changed

+42
-36
lines changed

IPython/core/completer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,9 +1362,9 @@ def filter_prefix_tuple(key):
13621362
# All checks passed!
13631363
return True
13641364

1365-
filtered_key_is_final: Dict[
1366-
Union[str, bytes, int, float], _DictKeyState
1367-
] = defaultdict(lambda: _DictKeyState.BASELINE)
1365+
filtered_key_is_final: Dict[Union[str, bytes, int, float], _DictKeyState] = (
1366+
defaultdict(lambda: _DictKeyState.BASELINE)
1367+
)
13681368

13691369
for k in keys:
13701370
# If at least one of the matches is not final, mark as undetermined.

IPython/core/guarded_eval.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,17 @@
4444

4545
@undoc
4646
class HasGetItem(Protocol):
47-
def __getitem__(self, key) -> None:
48-
...
47+
def __getitem__(self, key) -> None: ...
4948

5049

5150
@undoc
5251
class InstancesHaveGetItem(Protocol):
53-
def __call__(self, *args, **kwargs) -> HasGetItem:
54-
...
52+
def __call__(self, *args, **kwargs) -> HasGetItem: ...
5553

5654

5755
@undoc
5856
class HasGetAttr(Protocol):
59-
def __getattr__(self, key) -> None:
60-
...
57+
def __getattr__(self, key) -> None: ...
6158

6259

6360
@undoc
@@ -329,9 +326,9 @@ class EvaluationContext(NamedTuple):
329326
#: Global namespace
330327
globals: dict
331328
#: Evaluation policy identifier
332-
evaluation: Literal[
333-
"forbidden", "minimal", "limited", "unsafe", "dangerous"
334-
] = "forbidden"
329+
evaluation: Literal["forbidden", "minimal", "limited", "unsafe", "dangerous"] = (
330+
"forbidden"
331+
)
335332
#: Whether the evaluation of code takes place inside of a subscript.
336333
#: Useful for evaluating ``:-1, 'col'`` in ``df[:-1, 'col']``.
337334
in_subscript: bool = False

IPython/core/inputsplitter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
1616
For more details, see the class docstrings below.
1717
"""
18+
1819
from __future__ import annotations
1920

2021
from warnings import warn

IPython/core/tests/test_formatters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ def test_custom_repr_namedtuple_partialmethod():
535535
from functools import partialmethod
536536
from typing import NamedTuple
537537

538-
class Foo(NamedTuple):
539-
...
538+
class Foo(NamedTuple): ...
540539

541540
Foo.__repr__ = partialmethod(lambda obj: "Hello World")
542541
foo = Foo()

IPython/core/tests/test_inputtransformer2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
more complex. See test_inputtransformer2_line for tests for line-based
55
transformations.
66
"""
7+
78
import platform
89
import string
910
import sys

IPython/core/tests/test_paths.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,16 @@ def test_get_ipython_dir_8():
160160
# test only when HOME directory actually writable
161161
return
162162

163-
with patch.object(paths, "_writable_dir", lambda path: bool(path)), patch.object(
164-
paths, "get_xdg_dir", return_value=None
165-
), modified_env(
166-
{
167-
"IPYTHON_DIR": None,
168-
"IPYTHONDIR": None,
169-
"HOME": "/",
170-
}
163+
with (
164+
patch.object(paths, "_writable_dir", lambda path: bool(path)),
165+
patch.object(paths, "get_xdg_dir", return_value=None),
166+
modified_env(
167+
{
168+
"IPYTHON_DIR": None,
169+
"IPYTHONDIR": None,
170+
"HOME": "/",
171+
}
172+
),
171173
):
172174
assert paths.get_ipython_dir() == "/.ipython"
173175

IPython/external/qt_loaders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
This is used primarily by qt and qt_for_kernel, and shouldn't
99
be accessed directly from the outside
1010
"""
11+
1112
import importlib.abc
1213
import sys
1314
import os

IPython/lib/clipboard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Utilities for accessing the platform's clipboard.
22
"""
3+
34
import os
45
import subprocess
56

IPython/sphinxext/ipython_directive.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -904,15 +904,16 @@ class IPythonDirective(Directive):
904904

905905
has_content: bool = True
906906
required_arguments: int = 0
907-
optional_arguments: int = 4 # python, suppress, verbatim, doctest
907+
optional_arguments: int = 4 # python, suppress, verbatim, doctest
908908
final_argumuent_whitespace: bool = True
909-
option_spec: Dict[str, Any] = { 'python': directives.unchanged,
910-
'suppress' : directives.flag,
911-
'verbatim' : directives.flag,
912-
'doctest' : directives.flag,
913-
'okexcept': directives.flag,
914-
'okwarning': directives.flag
915-
}
909+
option_spec: Dict[str, Any] = {
910+
"python": directives.unchanged,
911+
"suppress": directives.flag,
912+
"verbatim": directives.flag,
913+
"doctest": directives.flag,
914+
"okexcept": directives.flag,
915+
"okwarning": directives.flag,
916+
}
916917

917918
shell = None
918919

IPython/terminal/interactiveshell.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,14 @@ def _merge_shortcuts(self, user_shortcuts):
586586
RuntimeBinding(
587587
command,
588588
keys=new_keys or old_keys,
589-
filter=filter_from_string(new_filter)
590-
if new_filter is not None
591-
else (
592-
old_filter
593-
if old_filter is not None
594-
else filter_from_string("always")
589+
filter=(
590+
filter_from_string(new_filter)
591+
if new_filter is not None
592+
else (
593+
old_filter
594+
if old_filter is not None
595+
else filter_from_string("always")
596+
)
595597
),
596598
)
597599
)

0 commit comments

Comments
 (0)