Skip to content

mypy errors because of _lru_cache_wrapper in v1.2.0 #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hofrob opened this issue Aug 9, 2023 · 1 comment
Closed

mypy errors because of _lru_cache_wrapper in v1.2.0 #208

hofrob opened this issue Aug 9, 2023 · 1 comment

Comments

@hofrob
Copy link

hofrob commented Aug 9, 2023

When updating from 1.0.0 to 1.2.0 we're seeing all kinds of mypy errors in our code base:

error: "_lru_cache_wrapper[EmailAddress | None]" has no attribute "name" [attr-defined]

At the moment, I'm not sure if this even needs to be fixed in this library, or is related to how we're using it. I found this open issue on mypy's tracker: python/mypy#5858

This affects all usages of

  • EmailAddress
  • MailAttachment
  • BaseMailBox

example

import imap_tools


def attachments(message: imap_tools.MailMessage) -> None:
    for attachment in message.attachments:
        ...

result

$ mypy main.py 
main.py:4: error: "_lru_cache_wrapper[list[MailAttachment]]" has no attribute "__iter__" (not iterable)  [attr-defined]
Found 1 error in 1 file (checked 1 source file)
@hofrob hofrob changed the title mypy errors in v1.2.0 mypy errors because of _lru_cache_wrapper in v1.2.0 Aug 9, 2023
@ikvk
Copy link
Owner

ikvk commented Nov 14, 2023

python/mypy#5858 seems closed and resolved. Let me know about bugs if in needs.

@ikvk ikvk closed this as completed Nov 14, 2023
@ikvk ikvk removed the help wanted label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants