Replies: 2 comments
-
Greetings @gramster! I'm just starting to dive back into Python after a few years in a TypeScript / .Net stack that inspired a love for static type checking. After a few days researching and attempting to configure it well in my project, I'm hyped about the massive developments in this space in the last few years but also full of questions trying to sort everything out. Hoping I can get some guidance here and hop on the bandwagon 😄. Some of my questions are:
Thank you very much in advance! |
Beta Was this translation helpful? Give feedback.
0 replies
-
1. You would typically use mypy (or pyrite, that pylance is built on) as a
static checker. Pylance is focused first and foremost on the editing
experience. So you could use them in conjunction. Pylance/pyright are
designed to be super performant, so that may be a reason to prefer pyright
over mypy, but some packages are configured to use mypy and its good to
honor that as there are subtle differences in the results you get from the
different static checkers.
2. The tools all follow standards. There may be some variation in the level
of support at the bleeding edge, especially for standards that are still in
the proposed state.
3. Most of the stubs in this repo are already included in pylance. I'm
currently working on much better matplotlib ones; stay tuned.
…On Tue, Jul 26, 2022 at 7:50 PM Alec Ostrander ***@***.***> wrote:
Greetings @gramster <https://github.com/gramster>!
I'm just starting to dive back into Python after a few years in a
TypeScript / .Net stack that inspired a love for static type checking.
After a few days researching and attempting to configure it well in my
project, I'm hyped about the massive developments in this space in the last
few years but also full of questions trying to sort everything out. Hoping
I can get some guidance here and hop on the bandwagon 😄.
Some of my questions are:
1. I entered this world while looking for improved typing for
sqlAlchemy, and their site led me to mypy
<https://docs.sqlalchemy.org/en/14/orm/extensions/mypy.html>. I
already had the Pylance extension installed, not fully realizing they seem
to be overlapping technologies. Is it recommended that I pick one to use in
particular, or is it acceptable to use these tools in conjunction?
2. My current understanding is that all of the big names in this space
use a common spec - PEP 561 / type stubs - to provide typing metadata where
inference breaks down. So theoretically any type stubs I find should be
compatible with either Pylance or mypy or anything else, regardless of
which tool their docs are referring to. Is that correct, or are there
tool-specific idiosyncrasies I should be aware of?
3. What is the best way to use the type stubs in this repo and other
places like typeshed? If I want get type hinting for matplotlib, for
example, do I need to download the stub folder and point my Pylance
instance to it locally? Or are these common sources already included in the
Pylance extension by default?
Thank you very much in advance!
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVCPCG6TC7ZB5Y327EHK5LVWCPX5ANCNFSM5NTB3E4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions