Comments (4)
Pylance requires type stubs to do the best job possible with type analysis. In this case, I'm presuming that you don't have a type stub available for celery, so it is doing its best to infer types from the library implementation based on the return type(s) of shared_task
. In this particular case, shared_task
returns two different types, and the type checker can't tell which one is returned for this particular call site. Both types are functions, but one of them is a function that requires a parameter called fun
, hence the error.
The best workaround in this case is to find (or create) a type stub for the celery package. A type stub will provide the proper annotations so the type checker can perform analysis correctly in this case without emitting an error.
If you can't find a type stub and don't want to create one, you can suppress this error using "# type: ignore".
from pylance-release.
I've updated the "missing argument" diagnostic to be off by default when typeCheckingMode is "off". Assuming that you haven't set typeCheckingMode to "basic" or "strict", this diagnostic will be suppressed. This change will be in the next version of Pylance.
from pylance-release.
ok thanks you very much for your feedback. I'll try to add so type stub for celery 👍
By the way, this is a great extension, very nice work 👏
from pylance-release.
This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020
from pylance-release.
Related Issues (20)
- Report for the high utilization of CPU while using Pylance HOT 2
- quick fix can't detect reportlab package HOT 2
- code unreachable -- but it's not HOT 3
- pip library HOT 1
- Allow setting --max-old-space-size when using python.analysis.nodeExecutable HOT 21
- Mouse over docstring is not consistent with `inspect.getdoc` when using multiple inheritance HOT 4
- Pylance 在过去 3 分钟内崩溃了 5 次。Pylance 不会重新启动。有关详细信息,请参阅输出。 in wsl windows project HOT 8
- Bundled type hints for lxml are inconsistent with source, lxml-stubs HOT 3
- Can't access certain members errors HOT 4
- looks like there is tokenizer bug? HOT 1
- No docstring shown for `dict.update`
- Show Type Hierarchy shows no results for types declared in notebooks
- Next step is unclear after pressing "Report Issue" for perf problem HOT 1
- VS Code flags "always" as an invalid value for `python.analysis.perfReporting` HOT 1
- Improve docs to clarify that import heuristics don't work for local imports HOT 6
- Doesnt register enter to go to next line HOT 1
- Incorrect or unhelpful error: "ClassVar" is not allowed in this context HOT 9
- Function Docstrings Obscured By Decorators That Return Protocols HOT 5
- Add semantic token modifiers to callable variables. HOT 3
- Save file lag HOT 2
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 pylance-release.