File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 1
1
from typing import Callable , Dict , List
2
2
3
- from asyncio import Queue , ensure_future
3
+ from asyncio import AbstractEventLoop , Queue , ensure_future
4
4
from inspect import isawaitable
5
5
6
6
from collections import defaultdict
11
11
class EventEmitter :
12
12
"""A very simple EventEmitter."""
13
13
14
- def __init__ (self , loop = None ) -> None :
14
+ def __init__ (self , loop : AbstractEventLoop = None ) -> None :
15
15
self .loop = loop
16
16
self .listeners : Dict [str , List [Callable ]] = defaultdict (list )
17
17
Original file line number Diff line number Diff line change 5
5
6
6
from graphql .subscription .map_async_iterator import MapAsyncIterator
7
7
8
- try :
9
- # noinspection PyUnresolvedReferences,PyUnboundLocalVariable
10
- anext
11
- except NameError : # anext does not yet exist in Python 3.6
12
- async def anext (iterable ):
13
- """Return the next item from an async iterator."""
14
- return await iterable .__anext__ ()
8
+ async def anext (iterable ):
9
+ """Return the next item from an async iterator."""
10
+ return await iterable .__anext__ ()
15
11
16
12
17
13
def describe_map_async_iterator ():
Original file line number Diff line number Diff line change 28
28
'inbox' : GraphQLField (InboxType )})
29
29
30
30
31
- try :
32
- # noinspection PyUnresolvedReferences,PyUnboundLocalVariable
33
- anext
34
- except NameError : # anext does not yet exist in Python 3.6
35
- async def anext (iterable ):
36
- """Return the next item from an async iterator."""
37
- return await iterable .__anext__ ()
31
+ async def anext (iterable ):
32
+ """Return the next item from an async iterator."""
33
+ return await iterable .__anext__ ()
38
34
39
35
40
36
def email_schema_with_resolvers (subscribe_fn = None , resolve_fn = None ):
You can’t perform that action at this time.
0 commit comments