Skip to content

Commit 30f0f80

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7e9f9e6 commit 30f0f80

28 files changed

Lines changed: 73 additions & 92 deletions

src/einspect/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Runtime patches."""
2+
23
from __future__ import annotations
34

45
import ctypes

src/einspect/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""CPython API Methods and intrinsic constants."""
2+
23
from __future__ import annotations
34

45
import ctypes

src/einspect/compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Python version compatibility constructs."""
2+
23
from __future__ import annotations
34

45
import sys

src/einspect/protocols/delayed_bind.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Decorator protocols for binding class properties."""
2+
23
from __future__ import annotations
34

45
import ctypes
@@ -116,9 +117,11 @@ def __get__(self, instance: object | None, owner_cls: type[_CT]) -> _F:
116117
", ".join(
117118
repr(x.__name__) if x is not None else "None" for x in argtypes
118119
),
119-
self.py_api.restype.__name__
120-
if self.py_api.restype is not None
121-
else "None",
120+
(
121+
self.py_api.restype.__name__
122+
if self.py_api.restype is not None
123+
else "None"
124+
),
122125
)
123126

124127
# Called as class method, return directly without binding

src/einspect/protocols/type_parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Parsing type hints."""
2+
23
from __future__ import annotations
34

45
import ctypes
@@ -24,8 +25,7 @@ class FuncPtr(Protocol):
2425
restype: type | None
2526
argtypes: Sequence[type]
2627

27-
def __call__(self, *args: Any, **kwargs: Any) -> Any:
28-
... # pragma: no cover
28+
def __call__(self, *args: Any, **kwargs: Any) -> Any: ... # pragma: no cover
2929

3030

3131
aliases = {

src/einspect/structs/deco.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@
3131

3232

3333
@overload
34-
def struct(*, fields: FieldsType) -> Callable[[_T], _T]:
35-
...
34+
def struct(*, fields: FieldsType) -> Callable[[_T], _T]: ...
3635

3736

3837
@overload
39-
def struct(cls: _T, fields: Literal[None] = ...) -> _T:
40-
...
38+
def struct(cls: _T, fields: Literal[None] = ...) -> _T: ...
4139

4240

4341
def struct(cls: _T | None = None, fields: FieldsType | None = None):

src/einspect/structs/include/object_h.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""https://github.com/python/cpython/blob/3.11/Include/object.h"""
2+
23
from __future__ import annotations
34

45
from ctypes import PYFUNCTYPE, c_char_p, c_int, c_void_p, py_object

src/einspect/structs/py_object.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Structures for CPython objects."""
2+
23
from __future__ import annotations
34

45
import ctypes
@@ -81,14 +82,12 @@ class PyObject(Struct, AsRef, Generic[_T, _KT, _VT]):
8182
ob_type: Annotated[ptr[PyTypeObject[Type[_T]]], c_void_p]
8283

8384
@overload
84-
def __new__(cls, __obj: _T | PyObject[_T, _KT, _VT]) -> PyObject[_T, _KT, _VT]:
85-
...
85+
def __new__(cls, __obj: _T | PyObject[_T, _KT, _VT]) -> PyObject[_T, _KT, _VT]: ...
8686

8787
@overload
8888
def __new__(
8989
cls, *, ob_refcnt: int = 1, ob_type: ptr[PyTypeObject], **kwargs
90-
) -> PyObject[_T, _KT, _VT]:
91-
...
90+
) -> PyObject[_T, _KT, _VT]: ...
9291

9392
def __new__(cls, __obj: _T = DEFAULT, **kwargs):
9493
"""

src/einspect/structs/py_tuple.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ def _format_fields_(self) -> Fields:
3333

3434
@overload
3535
@classmethod
36-
def from_object(cls, obj: tuple[_VT, ...]) -> PyTupleObject[_VT]:
37-
...
36+
def from_object(cls, obj: tuple[_VT, ...]) -> PyTupleObject[_VT]: ...
3837

3938
@overload
4039
@classmethod
41-
def from_object(cls, obj: tuple[...]) -> PyTupleObject[Any]:
42-
...
40+
def from_object(cls, obj: tuple[...]) -> PyTupleObject[Any]: ...
4341

4442
@classmethod
4543
def from_object(cls, obj: tuple[_VT, ...]) -> PyTupleObject[_VT]:

src/einspect/structs/py_unicode.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ class PyCompactUnicodeObject(PyASCIIObject):
234234

235235
utf8_length: int # Number of bytes in utf8, excluding the \0
236236
utf8: char_p # UTF-8 representation (null-terminated)
237-
wstr_length: int # Number of characters in wstr, surrogates count as two code points
237+
wstr_length: (
238+
int # Number of characters in wstr, surrogates count as two code points
239+
)
238240

239241
def _format_fields_(self) -> Fields:
240242
return {

0 commit comments

Comments
 (0)