On Tue, Nov 16, 2021 at 10:46 PM Shantanu Jain <hauntsaninja@gmail.com> wrote:
The line between classes and functions is blurry. For example, disallowing type aliases in functions would break code like:
def foo(x):
  bar = map
  return bar(lambda y: y+1, x)
because map is actually a class (and is typed as such in typeshed).

Note that this should pass a type checker regardless of what we choose.

Either `bar = map` is an alias definition or it is just a variable assignment.

It shouldn't be flagged as an invalid alias definition.
--Guido van Rossum (python.org/~guido)