mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-20 04:37:04 +08:00
Clean up a few Python 2 remnants (#8452)
This commit is contained in:
1 parent
ca633bbde8
commit
4414246a15
5 files changed
+3
-24
No files matched your search
@@ -435,8 +435,6 @@ Some further tips for good type hints:
|
||||
* avoid invariant collection types (`list`, `dict`) in argument
|
||||
positions, in favor of covariant types like `Mapping` or `Sequence`;
|
||||
* avoid union return types: https://github.com/python/mypy/issues/1693;
|
||||
* in Python 2, whenever possible, use `unicode` if that's the only
|
||||
possible type, and `Text` if it can be either `unicode` or `bytes`;
|
||||
* use platform checks like `if sys.platform == 'win32'` to denote
|
||||
platform-dependent APIs;
|
||||
* use mypy error codes for mypy-specific `# type: ignore` annotations,
|
||||
|
||||
Reference in new issue
Block a user