Skip to content

Commit 9c48624

Browse files
committed
reformat imports
1 parent 4cf2ef9 commit 9c48624

File tree

9 files changed

+31
-76
lines changed

9 files changed

+31
-76
lines changed

src/pointers/__init__.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,20 @@
77
from ._utils import force_set_attr
88
from .api_bindings import *
99
from .base_pointers import (
10-
BaseAllocatedPointer,
11-
BaseCPointer,
12-
BaseObjectPointer,
13-
BasePointer,
14-
BasicPointer,
15-
Dereferencable,
16-
IterDereferencable,
17-
Sized,
18-
Typed,
10+
BaseAllocatedPointer, BaseCPointer, BaseObjectPointer, BasePointer,
11+
BasicPointer, Dereferencable, IterDereferencable, Sized, Typed
1912
)
2013
from .bindings import *
2114
from .c_pointer import (
22-
TypedCPointer,
23-
VoidPointer,
24-
array,
25-
cast,
26-
to_c_ptr,
27-
to_struct_ptr,
28-
to_voidp,
15+
TypedCPointer, VoidPointer, array, cast, to_c_ptr, to_struct_ptr, to_voidp
2916
)
3017
from .calloc import AllocatedArrayPointer, calloc
3118
from .custom_binding import binding, binds
3219
from .decay import decay, decay_annotated, decay_wrapped
3320
from .exceptions import (
34-
AllocationError,
35-
DereferenceError,
36-
FreedMemoryError,
37-
InvalidBindingParameter,
38-
InvalidSizeError,
39-
NullPointerError,
40-
SegmentViolation,
21+
AllocationError, DereferenceError, FreedMemoryError,
22+
InvalidBindingParameter, InvalidSizeError, NullPointerError,
23+
SegmentViolation
4124
)
4225
from .magic import _
4326
from .malloc import AllocatedPointer, free, malloc, realloc

src/pointers/api_bindings.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
from ._pyapi import API_FUNCS, Func
44
from .base_pointers import BaseObjectPointer
55
from .bindings import (
6-
CharLike,
7-
PointerLike,
8-
StringLike,
9-
binding_base,
10-
make_char,
11-
make_string,
6+
CharLike, PointerLike, StringLike, binding_base, make_char, make_string
127
)
138
from .std_structs import *
149
from .structure import StructPointer

src/pointers/base_pointers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
import weakref
55
from abc import ABC, abstractmethod
66
from contextlib import suppress
7-
from typing import Any, Generic, Iterator, Optional, Tuple, Type, TypeVar, Union
7+
from typing import (
8+
Any, Generic, Iterator, Optional, Tuple, Type, TypeVar, Union
9+
)
810

9-
from _pointers import add_ref, remove_ref
1011
from typing_extensions import final
1112

13+
from _pointers import add_ref, remove_ref
14+
1215
from ._utils import deref, force_set_attr, move_to_mem
1316
from .exceptions import DereferenceError, FreedMemoryError, NullPointerError
1417
from .util import NULL, Nullable, handle

src/pointers/bindings.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@
33
import warnings
44
from types import FunctionType
55
from typing import (
6-
TYPE_CHECKING,
7-
Any,
8-
Callable,
9-
Dict,
10-
Iterable,
11-
Iterator,
12-
Optional,
13-
Sequence,
14-
Type,
15-
TypeVar,
16-
Union,
6+
TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, Optional, Sequence,
7+
Type, TypeVar, Union
178
)
189

1910
from _pointers import add_ref

src/pointers/decay.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from functools import wraps
44
from typing import Any, Callable, Dict, Tuple, TypeVar
55

6-
from typing_extensions import Annotated, ParamSpec, get_args, get_origin, get_type_hints
6+
from typing_extensions import (
7+
Annotated, ParamSpec, get_args, get_origin, get_type_hints
8+
)
79

810
from .object_pointer import Pointer, to_ptr
911

src/pointers/std_structs.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@
33

44
from ._cstd import div_t, lconv, ldiv_t, tm
55
from ._pyapi import (
6-
Py_buffer,
7-
Py_tss_t,
8-
PyCodeObject,
9-
PyFrameObject,
10-
PyInterpreterState,
11-
PyModuleDef,
12-
PyThreadState,
13-
PyType_Slot,
14-
PyType_Spec,
15-
PyTypeObject,
16-
PyVarObject,
6+
Py_buffer, Py_tss_t, PyCodeObject, PyFrameObject, PyInterpreterState,
7+
PyModuleDef, PyThreadState, PyType_Slot, PyType_Spec, PyTypeObject,
8+
PyVarObject
179
)
1810
from .c_pointer import TypedCPointer, VoidPointer
1911
from .structure import Struct, StructPointer

src/pointers/util.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
from contextlib import suppress
44
from functools import wraps
55
from io import UnsupportedOperation
6-
from typing import TYPE_CHECKING, Any, Callable, NamedTuple, Type, TypeVar, Union
6+
from typing import (
7+
TYPE_CHECKING, Any, Callable, NamedTuple, Type, TypeVar, Union
8+
)
79

8-
from _pointers import handle as _handle
910
from typing_extensions import ParamSpec
1011

12+
from _pointers import handle as _handle
13+
1114
from .exceptions import SegmentViolation
1215

1316
if TYPE_CHECKING:

tests/test_allocation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
from ward import raises, test
44

5-
from pointers import FreedMemoryError, InvalidSizeError, calloc, free, malloc, realloc
5+
from pointers import (
6+
FreedMemoryError, InvalidSizeError, calloc, free, malloc, realloc
7+
)
68

79

810
@test("malloc and free")

tests/test_bindings.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
from ward import raises, test
22

33
from pointers import (
4-
InvalidBindingParameter,
5-
Struct,
6-
StructPointer,
7-
TypedCPointer,
8-
VoidPointer,
4+
InvalidBindingParameter, Struct, StructPointer, TypedCPointer, VoidPointer
95
)
106
from pointers import _cstd as std
117
from pointers import (
12-
binds,
13-
c_free,
14-
c_malloc,
15-
cast,
16-
div,
17-
isspace,
18-
signal,
19-
sprintf,
20-
strcpy,
21-
strlen,
22-
to_c_ptr,
23-
to_struct_ptr,
24-
to_voidp,
25-
toupper,
8+
binds, c_free, c_malloc, cast, div, isspace, signal, sprintf, strcpy,
9+
strlen, to_c_ptr, to_struct_ptr, to_voidp, toupper
2610
)
2711
from pointers.std_structs import DivT
2812

0 commit comments

Comments
 (0)