Skip to content

Using decorator makes function loose type information #25

@Techcable

Description

@Techcable

Hi! This is an awesome library :)

I am using mypy with the --strict flag. The following code triggers an error:

class Database:
    @cachebox.cachedmethod(cachebox.FIFOCache(maxsize=4096))
    def load_year_meta(self, year: int) -> GenderMap[YearMeta]:
        pass

The error message is as follows

Untyped decorator makes function "load_year_meta" untyped [misc]

Could you please add type annotations to preserve the function's type? Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions