Comments (6)
Hm, but isn't it right though? There is no way for mypy to know if x is an instance of MyFoo
. It is an instance of IFoo
according to the description (or maybe None). It may be MyFoo
, or any other implementation of IFoo
.
from mypy-zope.
There is no way for mypy to know if x is an instance of
MyFoo
. It is an instance ofIFoo
according to the description (or maybe None). It may beMyFoo
, or any other implementation ofIFoo
.
I agree with this. But mypy cannot conclude from this that isinstance(x, MyFoo)
must be False in all circumstances---which is what I think leads to the unreachable
error.
from mypy-zope.
That's fair. I'll take to look.
from mypy-zope.
Many thanks! FWIW we've only seen this problem when checking our test, so it's not the end of the world as is!
from mypy-zope.
It is strange, but I can't repro it - see #92. @DMRobertson are you using some special mypy configuration to trigger the problem?
from mypy-zope.
Ahh, sorry. I should have double-checked this with a clean environment.
I think you need the --warn-unreachable
command line flag to see this behaviour. (I was using Synapse's mypy config which has this turned on by default.)
from mypy-zope.
Related Issues (20)
- exceptions.pyi doesn't contain MultipleInvalid HOT 3
- mypy 1.5.1 compatibility HOT 5
- mypy 1.7 support HOT 6
- mypy 1.8.0 release HOT 1
- `zope-stubs/__init__.pyi` prevents mypy from detecting `zope` as a namespace package HOT 1
- Subclasses of Twisted's amp fail to be determined by mypy-zope
- Doesn't quite understand that dynamically created classes are classes HOT 1
- Types for zope.component
- A way to express "A type which implements these N interfaces" HOT 3
- Error importing plugin "mypy_zope": cannot import name 'SemanticAnalyzerPass2' from 'mypy.semanal' HOT 2
- release that works with current mypy (==0.961) HOT 2
- Potential issue with mypy==0.970-dev HOT 1
- Caching errors with latest version of mypy HOT 1
- adaptation callable ought to return a union type with its second argument
- Regression in upcoming mypy 0.990 HOT 3
- Caching error (Metaclass conflict) with mypy 0.991 HOT 4
- make it possible to define a generic interface
- Follow semantic versioning in mypy version pins HOT 4
- mypy 1.3 compatibility HOT 1
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-zope.