| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- A top-level assert has no indentation. - An always-false condition is a check for sys.platform or sys.version_info or a condition derived from MYPY or from a name passed to --always-false; `assert False` doesn't count (!). Fixes python#5308
There was a problem hiding this comment.
Looks good, just a few minor comments.
Sorry, something went wrong.
| # Other systems | ||
|
|
||
| As a special case, you can also use one of these checks in a top-level | ||
| ``assert``; this makes mypy skip the rest of the file. Example: |
There was a problem hiding this comment.
Maybe explicitly mention that the assert must be unconditional and not nested within a statement.
Sorry, something went wrong.
| return 3 | ||
| [builtins fixtures/isinstance.pyi] | ||
|
|
||
| [case testUnreachableAfterToplevelAssert] |
There was a problem hiding this comment.
Maybe also test the case where the assert is nested within an if statement.
Sorry, something went wrong.
|
OK, updated doc and added test. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
A top-level assert has no indentation.
An always-false condition is a check for sys.platform or
sys.version_info or a condition derived from MYPY or from a name
passed to --always-false; assert False doesn't count (!).
(This definition is the same used to exclude conditional imports.)
Fixes #5308.