Strongly typed helper functions for object store __getitem__ and Tree.lookup_path #1457
castedo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Folks that use mypy (or similar) for type checking (especially in strict mode) might find either of these two helper functions useful. Or perhaps just some of the type-checking techniques demonstrated. This code will run on Python 3.9 (but you need much higher to run with mypy). I found them useful when porting from GitPython to Dulwich.
I've organized them into this small file:
https://gitlab.com/perm.pub/hidos/-/blob/912e65b32e872db48267d08105a2f4b119479853/hidos/dulwish.py
The contents are also copied below:
Beta Was this translation helpful? Give feedback.
All reactions