git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] userdiff: support Python async functions

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2019, 04:43 UTC
Message-ID
<xmqqtv79g0wx.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<f8a729c6-7b27-cac8-815e-b5c02a5c7b44@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 17 quoted lines
>> ...
>> @@ -0,0 +1,4 @@
>> +def RIGHT(pi: int = 3.14):
>> +    while True:
>> +        break
>> +    return ChangeMe()
>
> Thank you for providing test cases for Python.
>
> I have one gripe with this set of test, though: They do not demonstrate
> that the Python-specific pattern is better than the default pattern. In
> fact, if you remove the Python patterns from userdiff.c, you will
> observe that these tests still pass.
>
> The one thing that the language specific pattern would do better than
> the default is that it picks up indented text. Could we have a test case
> or two that show that it indeed does?

Good point. A method "def" inside a "class" would be one level indented; I am not sure if it is a kosher style to have "if" at the unindented top-level, whose body conditionally defines a "class", but such a class definition would also be indented, I guess.

Thanks.
Previous: Johannes Sixt
Message 4 of 4 in “userdiff: support Python async functions”
  1. userdiff: support Python async functionsJosh Holland, Nov 11, 2019
  2. Junio C HamanoNov 11, 2019
  3. Johannes SixtNov 11, 2019
  4. Junio C HamanoNov 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.