this is a place that *must* only be imported inside a if
typing.TYPE_CHECKING block. It is a mixture of smoothing over thinigs
that moved from typing_extensions to typing in later python versions and
useful but typing only code.
This makes typing_extensions required for python versions older than
3.8 *when running mypy*. typing_extensions should *only* be imported
inside an `if typing.TYPE_CHECKING` block (include the new _typing.py
module) to ensure that it doesn't become a runtime dependency
We're down to just declaring the data files in python now.
setup.cfg can, uniquely, retrieve version info by trying to parse the
AST for simple assignments (which we use) instead of importing the
entire module.
We have a single giant file for our tests, but a number of files that
match pytest's default discovery globs. To fix that, let's tell pytest
what to do.
This means you can just `pytest` and get the right results. It also
helps IDE's like vscode correctly identify tests.
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.
Fixes#7082
It has too many false positives. It was complaining about things like
if this:
fn = some_func
else:
fn = lambda x: ...
Where obviously, "fn" can't be a def, and it would be silly to introduce
some other name to use as the def, just to assign it to fn.