Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Makes classes compatible with mypy 1.2 #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thepabloaguilar wants to merge 1 commit into master
base: master
Choose a base branch
Loading
from bumps-mypy

Conversation

Copy link
Member

@thepabloaguilar thepabloaguilar commented Apr 11, 2023

Makes classes compatible with mypy 1.2

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

ayaka14732 reacted with thumbs up emoji
Copy link
Member Author

@sobolevn just need a little of your help here with the errors!

Copy link
Member

tests/test_typeclass/test_typed_dict.py:25: error: Invalid metaclass "_Meta" [misc]

This test needs some love.
https://github.com/dry-python/classes/blob/master/tests/test_typeclass/test_typed_dict.py#L9

Right now it is in a semi-broken state.

tests/test_typeclass/test_call.py:17: error: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases [misc]

Can be just ignored.
This is probably a mypy bug.
You can also report this to mypy.

tests/test_associated_type/test_variadic_generic.py:34: error: Function "Type[Example[Any]]" could always be true in boolean context [truthy-function]

Can be just ignored.

@thepabloaguilar thepabloaguilar force-pushed the bumps-mypy branch 3 times, most recently from b22e008 to 13d3f44 Compare April 12, 2023 03:11
Copy link

codecov-commenter commented Apr 12, 2023
edited
Loading

Codecov Report

Merging #487 (13d3f44) into master (4b0e9e5) will not change coverage.
The diff coverage is n/a.

@@ Coverage Diff @@
## master #487 +/- ##
=========================================
 Coverage 100.00% 100.00% 
=========================================
 Files 2 3 +1 
 Lines 103 106 +3 
 Branches 18 17 -1 
=========================================
+ Hits 103 106 +3 
Impacted Files Coverage Δ
classes/_typeclass.py 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member Author

I need to dig more deep to see why this expected error is not being raised anymore:

main:29: error: Instance "TypedDict('main.Other', {'name': builtins.str, 'registered': builtins.bool})" does not match inferred type "main.UserDict"

Copy link

Updated #483 to have also mypy^1.2.0. Can you guys either cherry-pick it here or review after this one is merged

Copy link
Member

Sure!

Copy link
Member

You can do the same for returns

zhukovgreen reacted with thumbs up emoji

Copy link

sobolevn reacted with thumbs up emoji

Copy link

I need to dig more deep to see why this expected error is not being raised anymore:

main:29: error: Instance "TypedDict('main.Other', {'name': builtins.str, 'registered': builtins.bool})" does not match inferred type "main.UserDict"

Hello. How are things going? If you wish, I can try to fix it.

Copy link
Member

@guitvcer you are very welcome to create a PR with new mypy version :)
It is rather hard to do, but I can help!

guitvcer reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /