view rustfmt.toml @ 49573:cc9a60050a07

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_.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 02 Nov 2022 17:30:57 -0400
parents 426294d06ddc
children
line wrap: on
line source

edition = "2018"
max_width = 79
wrap_comments = true
error_on_line_overflow = true