Skip to content

Covariance or contravariance #2

Closed
@gvanrossum

Description

@gvanrossum

As Lukasz mentions in NOTES-ambv.txt: "The covariance/contravariance discussion needs to happen at some point."

Reference: http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)

I haven't fully digested all the viewpoints yet. It seems that mypy stays on the safe side and treats e.g. Set[Employee] and Set[Manager] as distinct types. However, Set[Employee] is acceptable where a Set (without parameter) is expected.

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