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.