You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.py:2: error: Cannot instantiate abstract class '_BlakeHash' with abstract attributes 'copy', 'digest', 'hexdigest' and 'update'
test.py:3: error: Cannot instantiate abstract class '_BlakeHash' with abstract attributes 'copy', 'digest', 'hexdigest' and 'update'
This seems inconsistent with the non-blake derived hash functions (e.g. hashlib.md5(b'data').hexdigest()), which has behavior of passing mypy.
Potential Fix
Spelunking through the code, I believe this can be fixed by replacing
Bug Repro:
Running mypy 0.521 on the following python 3.6 snippet (inspiration taken from an example used in the official python 3.6.3 documentation.)
yields
This seems inconsistent with the non-blake derived hash functions (e.g.
hashlib.md5(b'data').hexdigest()
), which has behavior of passing mypy.Potential Fix
Spelunking through the code, I believe this can be fixed by replacing
typeshed/stdlib/3/hashlib.pyi
Lines 77 to 78 in c68dcf1
with
(plus any necessary tests to change :))
Running mypy on my local copy of hashlib.pyi passes the checker.
Happy to open a PR but wanted thoughts on this first.
The text was updated successfully, but these errors were encountered: