mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-20 04:37:04 +08:00
Recommend to use mypy error codes if applicable (#6305)
This commit is contained in:
1 parent
ccc09aa196
commit
77810277d5
3 files changed
+16
-13
No files matched your search
+3
-1
@@ -389,7 +389,9 @@ Some further tips for good type hints:
|
||||
* 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.
|
||||
platform-dependent APIs;
|
||||
* use mypy error codes for mypy-specific `# type: ignore` annotations,
|
||||
e.g. `# type: ignore[override]` for Liskov Substitution Principle violations.
|
||||
|
||||
Imports in stubs are considered private (not part of the exported API)
|
||||
unless:
|
||||
|
||||
Reference in new issue
Block a user