Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/graphql/pyutils/undefined.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The Undefined value"""

from __future__ import annotations
from typing_extensions import Self

import warnings

Expand All @@ -12,7 +13,7 @@ class UndefinedType:

_instance: UndefinedType | None = None

def __new__(cls) -> UndefinedType:
def __new__(cls) -> Self:
"""Create the Undefined singleton."""
if cls._instance is None:
cls._instance = super().__new__(cls)
Expand Down
3 changes: 2 additions & 1 deletion src/graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
cast,
overload,
)
from typing_extensions import Self

if TYPE_CHECKING:
from typing import TypeAlias, TypeGuard
Expand Down Expand Up @@ -232,7 +233,7 @@ class GraphQLNamedType(GraphQLType):

reserved_types: Mapping[str, GraphQLNamedType] = {}

def __new__(cls, name: str, *_args: Any, **_kwargs: Any) -> GraphQLNamedType:
def __new__(cls, name: str, *_args: Any, **_kwargs: Any) -> Self:
"""Create a GraphQL named type."""
if name in cls.reserved_types:
msg = f"Redefinition of reserved type {name!r}"
Expand Down
Loading