
Based on the feedback in https://github.com/python/black/pull/845#issuecomment-490622711 - Remove TokenizerConfig, and add a field to Grammar instead. - Pass the Grammar to the tokenizer. - Rename `ASYNC_IS_RESERVED_KEYWORD` to `ASYNC_KEYWORDS` and `ASYNC_IS_VALID_IDENTIFIER` to `ASYNC_IDENTIFIERS`.
66 lines
1.2 KiB
Python
66 lines
1.2 KiB
Python
#!/usr/bin/env python3.7
|
|
|
|
|
|
def f():
|
|
return (i * 2 async for i in arange(42))
|
|
|
|
|
|
def g():
|
|
return (
|
|
something_long * something_long
|
|
async for something_long in async_generator(with_an_argument)
|
|
)
|
|
|
|
|
|
async def func():
|
|
if test:
|
|
out_batched = [
|
|
i
|
|
async for i in aitertools._async_map(
|
|
self.async_inc, arange(8), batch_size=3
|
|
)
|
|
]
|
|
|
|
|
|
def awaited_generator_value(n):
|
|
return (await awaitable for awaitable in awaitable_list)
|
|
|
|
|
|
def make_arange(n):
|
|
return (i * 2 for i in range(n) if await wrap(i))
|
|
|
|
|
|
# output
|
|
|
|
|
|
#!/usr/bin/env python3.7
|
|
|
|
|
|
def f():
|
|
return (i * 2 async for i in arange(42))
|
|
|
|
|
|
def g():
|
|
return (
|
|
something_long * something_long
|
|
async for something_long in async_generator(with_an_argument)
|
|
)
|
|
|
|
|
|
async def func():
|
|
if test:
|
|
out_batched = [
|
|
i
|
|
async for i in aitertools._async_map(
|
|
self.async_inc, arange(8), batch_size=3
|
|
)
|
|
]
|
|
|
|
|
|
def awaited_generator_value(n):
|
|
return (await awaitable for awaitable in awaitable_list)
|
|
|
|
|
|
def make_arange(n):
|
|
return (i * 2 for i in range(n) if await wrap(i))
|