Skip to content
Snippets Groups Projects
Commit cc9a60050a07 authored by Matt Harbison's avatar Matt Harbison
Browse files

typing: add basic type hints to vfs.py

Again, there's a lot more that could be done, but this sticks to the obviously
correct stuff that is related to primitives or `vfs` objects.  Hopefully this
helps smoke out more path related bytes vs str issues in TortoiseHg.

PyCharm seems smart enough to apply hints from annotated superclass functions,
but pytype isn't (according to the *.pyi file generated), so those are annotated
too.

There was some discussion about changing the default path arg from `None` to
`b''` in order to avoid the more verbose `Optional` declarations.  This would be
more in line with `os.path.join()` (which rejects `None`, but ignores empty
strings), and still not change the behavior for callers still passing `None`
(because the check is `if path` instead of an explicit check for `None`).  But I
didn't want to hold this up while discussing that, so this documents what _is_.
parent c4f07a011714
No related branches found
No related tags found
2 merge requests!485branching: merge default into stable,!283Add basic type hints
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment