Skip to content

Passing a type as the first argument of map #8113

Closed
@cjolowicz

Description

@cjolowicz

The following expression should type-check fine, right?

map(list, [{1}])

The intended use is to convert (iterables of) sets to (iterables of) lists, e.g. to support slicing.

I'm getting this error:

main.py:1: error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[Set[int]], List[_T]]"
Found 1 error in 1 file (checked 1 source file)

This issue seems related to #3092.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongfalse-positivemypy gave an error on correct code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions