mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-18 03:52:24 +03:00
com2ann: Translate type comments into Python type annotations
This commit is contained in:
parent
d46332bd94
commit
e919260511
|
@ -16,7 +16,7 @@ EnumType = type(PyEnum)
|
|||
|
||||
|
||||
class EnumOptions(BaseOptions):
|
||||
enum: Enum = None
|
||||
enum: PyEnum = None
|
||||
deprecation_reason = None
|
||||
|
||||
|
||||
|
|
|
@ -9,11 +9,6 @@ if MYPY:
|
|||
from typing import Dict, Callable # NOQA
|
||||
|
||||
|
||||
class InputObjectTypeOptions(BaseOptions):
|
||||
fields: Dict[str, InputField] = None
|
||||
container: InputObjectTypeContainer = None
|
||||
|
||||
|
||||
class InputObjectTypeContainer(dict, BaseType):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -27,6 +22,11 @@ class InputObjectTypeContainer(dict, BaseType):
|
|||
pass
|
||||
|
||||
|
||||
class InputObjectTypeOptions(BaseOptions):
|
||||
fields: Dict[str, InputField] = None
|
||||
container: InputObjectTypeContainer = None
|
||||
|
||||
|
||||
class InputObjectType(UnmountedType, BaseType):
|
||||
"""
|
||||
Input Object Type Definition
|
||||
|
|
|
@ -8,11 +8,6 @@ if MYPY:
|
|||
from typing import Dict, Iterable, Type # NOQA
|
||||
|
||||
|
||||
class InterfaceOptions(BaseOptions):
|
||||
fields: Dict[str, Field] = None
|
||||
interfaces: Iterable[Type[Interface]] = ()
|
||||
|
||||
|
||||
class Interface(BaseType):
|
||||
"""
|
||||
Interface Type Definition
|
||||
|
@ -73,3 +68,8 @@ class Interface(BaseType):
|
|||
|
||||
def __init__(self, *args, **kwargs):
|
||||
raise Exception("An Interface cannot be initialized")
|
||||
|
||||
|
||||
class InterfaceOptions(BaseOptions):
|
||||
fields: Dict[str, Field] = None
|
||||
interfaces: Iterable[Type[Interface]] = ()
|
||||
|
|
Loading…
Reference in New Issue
Block a user