Page MenuHomeSoftware Heritage

typing: make recent mypy (0.812) pass again
ClosedPublic

Authored by zack on Feb 26 2021, 5:14 PM.

Diff Detail

Repository
rDFUSE FUSE virtual file system
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5161 (id=18458)

Rebasing onto fa32c040e2...

Current branch diff-target is up to date.
Changes applied before test
commit 57d375a3ffee9150f89574d902e3dda8ab94714d
Author: Stefano Zacchiroli <zack@upsilon.cc>
Date:   Fri Feb 26 17:14:00 2021 +0100

    typing: make recent mypy (0.812) pass again

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/267/ for more details.

zack requested review of this revision.Feb 26 2021, 5:18 PM
ardumont added a subscriber: ardumont.

Great.

Thanks for unstucking it (I noticed this morning it's been a month since it got red ¯\_(ツ)_/¯ ;)

swh/fuse/fs/entry.py
105

Is it expected you removed that type annotation here?

This revision is now accepted and ready to land.Feb 26 2021, 5:42 PM
swh/fuse/fs/entry.py
105

Yeah, because putting there the actual type (the one that subclasses must implement) doesn't type properly because the function body doesn't contain a yield. It used to work with previous versions of mypy, but no longer does. I guess there might be better solutions, but this looked good enough for now to me.

This revision was automatically updated to reflect the committed changes.