Skip to content

PyCharm indicates wrong type for lambda #928

@michaeloliverx

Description

@michaeloliverx

Bug report

What's wrong

While using PyCharm, lambda type in Schema results in Expected type 'FunctionType', got '() -> Dict[str, Union[str, Any]]' instead
Screenshot 2020-08-28 at 07 59 37

How is that should be

Is this warning correct? The code runs perfectly fine but maybe the Type maybe be wrong here. On this SO post they mentioned using the from typing import Callable for type hinting a lambda.

System information

❯ python3 --version
Python 3.8.5

❯ sw_vers
ProductName:	macOS
ProductVersion:	11.0
BuildVersion:	20A5354i

PyCharm 2020.2.1

Metadata

Metadata

Assignees

Labels

bugUnexpected behaviour and bugs

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions