Comments (1)
The error is to prevent people from attempting to do things with the return values of functions that return None
. Whether or not that thing is an assertion doesn't really seem relevant. As the point of Mypy is to statically verify things, supporting constructs used with dynamic type verification seem to be outside of the scope of Mypy. You can type: ignore[func-returns-value]
if you need to.
At a minimum I'd argue this is a feature request, not a bug
from mypy.
Related Issues (20)
- Walrus operator overwrites type hint
- Wrong SynchronizedArray type
- "valid-type" & "Invalid base class" with decorators for classes HOT 1
- Overloads not resolved correctly when argument is `Any` and return types use `TypeGuard` or `TypeIs` HOT 4
- Windows and MacOS: Packages under the Python or virtual environment 'Lib\site-packages' folder are never found HOT 1
- Pydantic plugin crash HOT 1
- Dict literal of type `A` cannot be assigned to variable of type `A | B` (incompatible type error) HOT 4
- Mypy fails type-check when using `Generic["Something"]` instead of `Generic[Something]` HOT 2
- `partial` plugin does not handle overloads HOT 2
- Another AssertionError with TypedDict and --cache-fine-grained in v1.11.0 HOT 1
- Class structural pattern matching always returns `Any` as type
- (🐞) can't use def from one base to satisfy another
- TypeError: mypy.types.TypeVarId object expected; got int HOT 3
- type of expression "Literal['fred']" wrong HOT 2
- Spurious redef warning in an odd situation with type(None) plus TypeAlias plus a later # type: ignore
- Reassigning `type` fails to typecheck
- Crash in version 1.11 lambda processing (regression since version 1.10) HOT 2
- [PEP 695] Nested generic class fails to typecheck HOT 1
- Feature Request: Add configuration to disallow/warn about usage of blanket `# type: ignore` HOT 2
- Incorrect `TypeIs` narrowing for tuples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mypy.