Skip to content

Commit a1b7e6b

Browse files
committed
refactor: Rename function, reformat
1 parent 202cdad commit a1b7e6b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

injector/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,8 +1208,10 @@ def _is_new_union_type(instance: Any) -> bool:
12081208
new_union_type = getattr(types, 'UnionType', None)
12091209
return new_union_type is not None and isinstance(instance, new_union_type)
12101210

1211-
def _is_package_annotation(annotation: Any) -> bool:
1212-
return _is_specialization(annotation, Annotated) and (_inject_marker in annotation.__metadata__ or _noinject_marker in annotation.__metadata__)
1211+
def _is_injection_annotation(annotation: Any) -> bool:
1212+
return _is_specialization(annotation, Annotated) and (
1213+
_inject_marker in annotation.__metadata__ or _noinject_marker in annotation.__metadata__
1214+
)
12131215

12141216
spec = inspect.getfullargspec(callable)
12151217

@@ -1242,7 +1244,7 @@ def _is_package_annotation(annotation: Any) -> bool:
12421244

12431245
for k, v in list(bindings.items()):
12441246
# extract metadata only from Inject and NonInject
1245-
if _is_package_annotation(v):
1247+
if _is_injection_annotation(v):
12461248
v, metadata = v.__origin__, v.__metadata__
12471249
bindings[k] = v
12481250
else:

0 commit comments

Comments
 (0)