Skip to content

Type checker thinks pendulum.travel_to() does not implement Traveller.__exit__ #973

Description

@amotl

Hi there,

we observed a false positive on type checking when using ty 0.0.52 on a downstream project. When using pendulum.travel_to() as a context manager, ty complains like this:

error[invalid-context-manager]: Object of type `pendulum.testing.traveller.Traveller @ traveller.py:64:15 | pendulum.testing.traveller.Traveller @ traveller.py:167:11`
cannot be used with `with` because it does not correctly implement `__exit__`

We've already reported it to the ty issue tracker:

With kind regards,
Andreas.

/cc @carljm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions