Subject: 28.0.91; python.el: Fancy 'outline-heading-end-regexp' doesn't work well

From: Augusto Stoffel <[email-masked]>
Date: Thu, 10 Feb 2022 10:14:49 +0100

In python-mode, 'outline-heading-end-regexp' is set to ":[^\n]*\n", so
that a folded function definition still displays the argument list, like
this:

```
def f(
    a,
    b
):...
```

This is marginally nicer than what one would normally get, namely

```
def f(...
```

However, with the introduction of type hints, this special outline end
regexp doesn't work well anymore.  For instance, the code

```
def f(
    a: int,
    b: str
) -> bool:
    pass
```

folds as

```
def f(
    a: int,...
```

which is much worse than not trying to be fancy.

In view of that, I would suggest to keep 'outline-heading-end-regexp' at
its default value of "\n" in pyhton-mode.