Stop using Any in TypeVar bound to Database#6649
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6649 +/- ##
=======================================
Coverage 72.46% 72.46%
=======================================
Files 161 161
Lines 20710 20710
Branches 3276 3276
=======================================
Hits 15007 15007
Misses 4977 4977
Partials 726 726
🚀 New features to boost your workflow:
|
c330e23 to
7a1c546
Compare
|
What do we gain from this in practical terms? |
7a1c546 to
3973a6c
Compare
|
In Python, def example(m: Model) -> None:
return m.db # type: Any. Now, by replacing |
3973a6c to
fff03be
Compare
Already made mypy catch some incorrect ones
fff03be to
81e6dab
Compare
|
The main reason why we had This is why I'm asking whether making this typing stricter has any practical benefits. From what I can see, it simply makes type definitions more verbose without a clear benefit. |
Description
This makes the type annotations in dbcore slightly stricter
https://peps.python.org/pep-0484/#covariance-and-contravariance
To Do
Documentation. (If you've added a new command-line flag, for example, find the appropriate page underdocs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)