All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 from third_party import X, Y, Z
7 from library import some_connection, \
12 if True: raise RuntimeError
17 exec("new-style exec", {}, {})
19 async def coroutine(arg, exec=False):
20 "Single-line docstring. Multiline is harder to reformat."
21 async with some_connection() as conn:
22 await conn.do_what_i_mean('SELECT bobby, tables FROM xkcd', timeout=2)
23 await asyncio.sleep(1)
29 def function_signature_stress_test(number:int,no_annotation=None,text:str="default",* ,debug:bool=False,**kwargs) -> str:
30 return text[number:-1]
31 def spaces(a=1, b=(), c=[], d={}, e=True, f=-1, g=1 if False else 2, h="", i=r''):
32 offset = attr.ib(default=attr.Factory( lambda: _r.uniform(10000, 200000)))
33 assert task._cancel_stack[:len(old_stack)] == old_stack
34 def spaces_types(a: int = 1, b: tuple = (), c: list = [], d: dict = {}, e: bool = True, f: int = -1, g: int = 1 if False else 2, h: str = "", i: str = r''): ...
35 def spaces2(result= _core.Value(None)):
36 assert fut is self._read_fut, (fut, self._read_fut)
37 # EMPTY LINE WITH WHITESPACE (this comment will be removed)
39 result = session.query(models.Customer.id).filter(
40 models.Customer.account_id == account_id,
41 models.Customer.email == email_address,
43 models.Customer.id.asc()
48 gen_annotated_params(ast_args.kwonlyargs, ast_args.kw_defaults, parameters, implicit_default=True)
52 ast_args.kwonlyargs, ast_args.kw_defaults, parameters, implicit_default=True,
53 # trailing standalone comment
56 _type_comment_re = re.compile(
64 (?<!ignore) # note: this will force the non-greedy + in <type> to match
65 # a trailing space which is why we need the silliness below
66 (?<!ignore[ ]{1})(?<!ignore[ ]{2})(?<!ignore[ ]{3})(?<!ignore[ ]{4})
67 (?<!ignore[ ]{5})(?<!ignore[ ]{6})(?<!ignore[ ]{7})(?<!ignore[ ]{8})
68 (?<!ignore[ ]{9})(?<!ignore[ ]{10})
75 """, re.MULTILINE | re.VERBOSE
79 A: 0.25 * (10.0 / 12),
90 very_long_argument_name1=very_long_value_for_the_argument,
91 very_long_argument_name2=very_long_value_for_the_argument,
95 def __await__(): return (yield)
100 #!/usr/bin/env python3
104 from third_party import X, Y, Z
106 from library import some_connection, some_decorator
122 exec("new-style exec", {}, {})
126 async def coroutine(arg, exec=False):
127 "Single-line docstring. Multiline is harder to reformat."
128 async with some_connection() as conn:
129 await conn.do_what_i_mean("SELECT bobby, tables FROM xkcd", timeout=2)
130 await asyncio.sleep(1)
134 @some_decorator(with_args=True, many_args=[1, 2, 3])
135 def function_signature_stress_test(
138 text: str = "default",
143 return text[number:-1]
146 def spaces(a=1, b=(), c=[], d={}, e=True, f=-1, g=1 if False else 2, h="", i=r""):
147 offset = attr.ib(default=attr.Factory(lambda: _r.uniform(10000, 200000)))
148 assert task._cancel_stack[: len(old_stack)] == old_stack
158 g: int = 1 if False else 2,
165 def spaces2(result=_core.Value(None)):
166 assert fut is self._read_fut, (fut, self._read_fut)
169 def example(session):
170 result = session.query(models.Customer.id).filter(
171 models.Customer.account_id == account_id, models.Customer.email == email_address
172 ).order_by(models.Customer.id.asc()).all()
177 typedargslist.extend(
178 gen_annotated_params(
180 ast_args.kw_defaults,
182 implicit_default=True,
185 typedargslist.extend(
186 gen_annotated_params(
188 ast_args.kw_defaults,
190 implicit_default=True,
191 # trailing standalone comment
194 _type_comment_re = re.compile(
202 (?<!ignore) # note: this will force the non-greedy + in <type> to match
203 # a trailing space which is why we need the silliness below
204 (?<!ignore[ ]{1})(?<!ignore[ ]{2})(?<!ignore[ ]{3})(?<!ignore[ ]{4})
205 (?<!ignore[ ]{5})(?<!ignore[ ]{6})(?<!ignore[ ]{7})(?<!ignore[ ]{8})
206 (?<!ignore[ ]{9})(?<!ignore[ ]{10})
214 re.MULTILINE | re.VERBOSE,
218 def trailing_comma():
220 A: 0.25 * (10.0 / 12),
221 B: 0.1 * (10.0 / 12),
222 C: 0.1 * (10.0 / 12),
223 D: 0.1 * (10.0 / 12),
227 def f(a, **kwargs) -> A:
230 very_long_argument_name1=very_long_value_for_the_argument,
231 very_long_argument_name2=very_long_value_for_the_argument,