Skip to content

Explain the Any type in more detail #25

@JukkaL

Description

@JukkaL

The PEP draft talks about Any as a union type, but in mypy it's actually very different from a union type. For example:

  • List[Any] is compatible with List[int] (and vice versa), but this is not true for union types.
  • A value of type Any can be assigned to a variable with an arbitrary type and vice versa, which is not true for union types.

I think we should be more explicit about at least some of the expected properties of the Any type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions