Skip to content
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

mypy-nonfloat-decimal broken on release-0.960 #12861

Closed
rouge8 opened this issue May 24, 2022 · 2 comments
Closed

mypy-nonfloat-decimal broken on release-0.960 #12861

rouge8 opened this issue May 24, 2022 · 2 comments
Labels
bug mypy got something wrong

Comments

@rouge8
Copy link

rouge8 commented May 24, 2022

Bug Report

mypy-nonfloat-decimal no longer works on 128661c. Mentioned on #12807 (comment), but was told to open an issue. :) I also have an internal plugin using get_dynamic_class_hook() that is no longer working, but that's probably a separate issue and harder to breakdown.

To Reproduce

(Write your steps here:)

  1. pip install mypy-nonfloat-decimal https://github.com/python/mypy/archive/128661ccbf4396ed1538421c481f1773c7490169.zip#egg=mypy
  2. t.py:
from decimal import Decimal

Decimal(1.2)
  1. mypy.ini:
[mypy]
plugins = mypy_nonfloat_decimal
  1. mypy t.py

Expected Behavior

t.py:3: error: Invalid type passed to Decimal (expected "Union[int, str, Decimal]"), got builtins.float instead (offender: float)
Found 1 error in 1 file (checked 1 source file)

Actual Behavior

Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 128661c
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.10.4
  • Operating system and version: macOS 12.3.1
@rouge8 rouge8 added the bug mypy got something wrong label May 24, 2022
@JelleZijlstra
Copy link
Member

This is most likely because of python/typeshed#7640. The plugin needs to look for _decimal.Decimal instead.

@rouge8
Copy link
Author

rouge8 commented May 24, 2022

Ah you're right, that one's easy. I'll try and reproduce the internal plugin that no longer seems to work tonight or tomorrow.

@rouge8 rouge8 closed this as completed May 24, 2022
rouge8 added a commit to rouge8/mypy-nonfloat-decimal that referenced this issue May 24, 2022
yedpodtrzitko pushed a commit to yedpodtrzitko/mypy-nonfloat-decimal that referenced this issue May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants