Skip to content

Commit 8580c4e

Browse files
committed
Remove PyCharm specific comments
These were not needed any more and partially outdated anyway after switching to VS Code and relying on ruff and mypy.
1 parent e306a5e commit 8580c4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+0
-155
lines changed

src/graphql/execution/collect_fields.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ def does_fragment_condition_match(
319319
if conditional_type is type_:
320320
return True
321321
if is_abstract_type(conditional_type):
322-
# noinspection PyTypeChecker
323322
return schema.is_sub_type(conditional_type, type_)
324323
return False
325324

src/graphql/execution/execute.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
try: # pragma: no cover
120120
anext # noqa: B018 # pyright: ignore
121121
except NameError: # pragma: no cover (Python < 3.10)
122-
# noinspection PyShadowingBuiltins
123122
async def anext(iterator: AsyncIterator) -> Any:
124123
"""Return the next item from an async iterator."""
125124
return await iterator.__anext__()
@@ -445,7 +444,6 @@ def execute_root_grouped_field_set(
445444
defer_map: RefMap[DeferUsage, DeferredFragmentRecord] | None,
446445
) -> AwaitableOrValue[GraphQLWrappedResult[dict[str, Any]]]:
447446
"""Execute the root grouped field set."""
448-
# noinspection PyTypeChecker
449447
return (
450448
self.execute_fields_serially
451449
if operation == OperationType.MUTATION
@@ -506,7 +504,6 @@ async def set_result() -> GraphQLWrappedResult[dict[str, Any]]:
506504
graphql_wrapped_result.add_increments(resolved.increments)
507505
return graphql_wrapped_result
508506

509-
# noinspection PyTypeChecker
510507
return async_reduce(
511508
reducer, grouped_field_set.items(), GraphQLWrappedResult({})
512509
)
@@ -647,7 +644,6 @@ def execute_field(
647644
defer_map,
648645
)
649646
if self.is_awaitable(completed):
650-
# noinspection PyShadowingNames
651647
async def await_completed() -> Any:
652648
try:
653649
return await completed
@@ -1168,7 +1164,6 @@ def complete_iterable_value(
11681164
if not awaitable_indices:
11691165
return graphql_wrapped_result
11701166

1171-
# noinspection PyShadowingNames
11721167
async def get_completed_results() -> GraphQLWrappedResult[list[Any]]:
11731168
if len(awaitable_indices) == 1:
11741169
# If there is only one index, avoid the overhead of parallelization.
@@ -1216,7 +1211,6 @@ def complete_list_item_value(
12161211
)
12171212

12181213
if is_awaitable(completed_item):
1219-
# noinspection PyShadowingNames
12201214
async def await_completed() -> Any:
12211215
try:
12221216
resolved = await completed_item # type: ignore
@@ -1421,7 +1415,6 @@ def ensure_valid_runtime_type(
14211415
)
14221416
raise GraphQLError(msg, to_nodes(field_group))
14231417

1424-
# noinspection PyTypeChecker
14251418
return runtime_type
14261419

14271420
def complete_object_value(
@@ -2674,7 +2667,6 @@ def execute_subscription(
26742667

26752668
result = resolve_fn(context.root_value, info, **args)
26762669
if context.is_awaitable(result):
2677-
# noinspection PyShadowingNames
26782670
async def await_result() -> AsyncIterable[Any]:
26792671
try:
26802672
return assert_event_stream(await result)

src/graphql/language/ast.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ def __copy__(self) -> Node:
404404

405405
def __deepcopy__(self, memo: dict) -> Node:
406406
"""Create a deep copy of the node"""
407-
# noinspection PyArgumentList
408407
return self.__class__(
409408
**{key: deepcopy(getattr(self, key), memo) for key in self.keys}
410409
)
@@ -422,7 +421,6 @@ def __init_subclass__(cls) -> None:
422421
cls.kind = camel_to_snake(name)
423422
keys: list[str] = []
424423
for base in cls.__bases__:
425-
# noinspection PyUnresolvedReferences
426424
keys.extend(base.keys) # type: ignore
427425
keys.extend(cls.__slots__)
428426
cls.keys = tuple(keys)

src/graphql/language/parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ def parse_list(self, is_const: bool) -> ListValueNode:
582582
"""ListValue[Const]"""
583583
start = self._lexer.token
584584
item = partial(self.parse_value_literal, is_const)
585-
# noinspection PyTypeChecker
586585
return ListValueNode(
587586
values=self.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
588587
loc=self.loc(start),

src/graphql/pyutils/suggestion_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def suggestion_list(input_: str, options: Collection[str]) -> list[str]:
2424
if distance is not None:
2525
options_by_distance[option] = distance
2626

27-
# noinspection PyShadowingNames
2827
return sorted(
2928
options_by_distance,
3029
key=lambda option: (

src/graphql/type/definition.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ def parse_literal(
432432

433433
def to_kwargs(self) -> GraphQLScalarTypeKwargs:
434434
"""Get corresponding arguments."""
435-
# noinspection PyArgumentList
436435
return GraphQLScalarTypeKwargs(
437436
super().to_kwargs(), # type: ignore
438437
serialize=None
@@ -771,7 +770,6 @@ def __init__(
771770

772771
def to_kwargs(self) -> GraphQLObjectTypeKwargs:
773772
"""Get corresponding arguments."""
774-
# noinspection PyArgumentList
775773
return GraphQLObjectTypeKwargs(
776774
super().to_kwargs(), # type: ignore
777775
fields=self.fields.copy(),
@@ -876,7 +874,6 @@ def __init__(
876874

877875
def to_kwargs(self) -> GraphQLInterfaceTypeKwargs:
878876
"""Get corresponding arguments."""
879-
# noinspection PyArgumentList
880877
return GraphQLInterfaceTypeKwargs(
881878
super().to_kwargs(), # type: ignore
882879
fields=self.fields.copy(),
@@ -981,7 +978,6 @@ def __init__(
981978

982979
def to_kwargs(self) -> GraphQLUnionTypeKwargs:
983980
"""Get corresponding arguments."""
984-
# noinspection PyArgumentList
985981
return GraphQLUnionTypeKwargs(
986982
super().to_kwargs(), # type: ignore
987983
types=self.types,
@@ -1112,7 +1108,6 @@ def __init__(
11121108

11131109
def to_kwargs(self) -> GraphQLEnumTypeKwargs:
11141110
"""Get corresponding arguments."""
1115-
# noinspection PyArgumentList
11161111
return GraphQLEnumTypeKwargs(
11171112
super().to_kwargs(), # type: ignore
11181113
values=self.values.copy(),
@@ -1341,7 +1336,6 @@ def out_type(value: dict[str, Any]) -> Any:
13411336

13421337
def to_kwargs(self) -> GraphQLInputObjectTypeKwargs:
13431338
"""Get corresponding arguments."""
1344-
# noinspection PyArgumentList
13451339
return GraphQLInputObjectTypeKwargs(
13461340
super().to_kwargs(), # type: ignore
13471341
fields=self.fields.copy(),

src/graphql/type/introspection.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ def is_repeatable(directive, _info):
154154
def locations(directive, _info):
155155
return directive.locations
156156

157-
# noinspection PyPep8Naming
158157
@staticmethod
159158
def args(directive, _info, includeDeprecated=False):
160159
items = directive.args.items()
@@ -343,7 +342,6 @@ def description(type_, _info):
343342
def specified_by_url(type_, _info):
344343
return getattr(type_, "specified_by_url", None)
345344

346-
# noinspection PyPep8Naming
347345
@staticmethod
348346
def fields(type_, _info, includeDeprecated=False):
349347
if not (is_object_type(type_) or is_interface_type(type_)):
@@ -369,7 +367,6 @@ def possible_types(type_, info):
369367
info.schema.get_possible_types(type_) if is_abstract_type(type_) else None
370368
)
371369

372-
# noinspection PyPep8Naming
373370
@staticmethod
374371
def enum_values(type_, _info, includeDeprecated=False):
375372
if not is_enum_type(type_):
@@ -381,7 +378,6 @@ def enum_values(type_, _info, includeDeprecated=False):
381378
else [item for item in items if item[1].deprecation_reason is None]
382379
)
383380

384-
# noinspection PyPep8Naming
385381
@staticmethod
386382
def input_fields(type_, _info, includeDeprecated=False):
387383
if not is_input_object_type(type_):
@@ -450,7 +446,6 @@ def name(item, _info):
450446
def description(item, _info):
451447
return item[1].description
452448

453-
# noinspection PyPep8Naming
454449
@staticmethod
455450
def args(item, _info, includeDeprecated=False):
456451
items = item[1].args.items()

src/graphql/type/validate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def validate_schema(schema: GraphQLSchema) -> list[GraphQLError]:
5757
assert_schema(schema)
5858

5959
# If this Schema has already been validated, return the previous results.
60-
# noinspection PyProtectedMember
6160
errors = schema._validation_errors # noqa: SLF001
6261
if errors is None:
6362
# Validate the schema, producing a list of errors.

src/graphql/utilities/extend_schema.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ def extend_schema_args(
279279
assume_valid=assume_valid,
280280
)
281281

282-
# noinspection PyTypeChecker,PyUnresolvedReferences
283282
def replace_type(self, type_: GraphQLType) -> GraphQLType:
284283
"""Replace a GraphQL type."""
285284
if is_list_type(type_):
@@ -295,7 +294,6 @@ def replace_named_type(self, type_: GraphQLNamedType) -> GraphQLNamedType:
295294
# validation with validate_schema() will produce more actionable results.
296295
return self.type_map[type_.name]
297296

298-
# noinspection PyShadowingNames
299297
def replace_directive(self, directive: GraphQLDirective) -> GraphQLDirective:
300298
"""Replace a GraphQL directive."""
301299
if is_specified_directive(directive):
@@ -351,7 +349,6 @@ def extend_input_object_type_fields(
351349
**self.build_input_field_map(extensions),
352350
}
353351

354-
# noinspection PyShadowingNames
355352
def extend_input_object_type(
356353
self,
357354
type_: GraphQLInputObjectType,
@@ -421,7 +418,6 @@ def extend_object_type_fields(
421418
**self.build_field_map(extensions),
422419
}
423420

424-
# noinspection PyShadowingNames
425421
def extend_object_type(self, type_: GraphQLObjectType) -> GraphQLObjectType:
426422
"""Extend a GraphQL object type."""
427423
kwargs = type_.to_kwargs()
@@ -459,7 +455,6 @@ def extend_interface_type_fields(
459455
**self.build_field_map(extensions),
460456
}
461457

462-
# noinspection PyShadowingNames
463458
def extend_interface_type(
464459
self, type_: GraphQLInterfaceType
465460
) -> GraphQLInterfaceType:
@@ -500,7 +495,6 @@ def extend_union_type(self, type_: GraphQLUnionType) -> GraphQLUnionType:
500495
),
501496
)
502497

503-
# noinspection PyShadowingNames
504498
def extend_field(self, field: GraphQLField) -> GraphQLField:
505499
"""Extend a GraphQL field."""
506500
return GraphQLField(
@@ -520,7 +514,6 @@ def extend_arg(self, arg: GraphQLArgument) -> GraphQLArgument:
520514
)
521515
)
522516

523-
# noinspection PyShadowingNames
524517
def get_operation_types(
525518
self, nodes: Collection[SchemaDefinitionNode | SchemaExtensionNode]
526519
) -> dict[OperationType, GraphQLNamedType]:
@@ -534,7 +527,6 @@ def get_operation_types(
534527
for operation_type in node.operation_types or []
535528
}
536529

537-
# noinspection PyShadowingNames
538530
def get_named_type(self, node: NamedTypeNode) -> GraphQLNamedType:
539531
"""Get name GraphQL type for a given named type node."""
540532
name = node.name.value

src/graphql/utilities/type_comparators.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ def is_equal_type(type_a: GraphQLType, type_b: GraphQLType) -> bool:
2525

2626
# If either type is non-null, the other must also be non-null.
2727
if is_non_null_type(type_a) and is_non_null_type(type_b):
28-
# noinspection PyUnresolvedReferences
2928
return is_equal_type(type_a.of_type, type_b.of_type)
3029

3130
# If either type is a list, the other must also be a list.
3231
if is_list_type(type_a) and is_list_type(type_b):
33-
# noinspection PyUnresolvedReferences
3432
return is_equal_type(type_a.of_type, type_b.of_type)
3533

3634
# Otherwise the types are not equal.

0 commit comments

Comments
 (0)