Skip to content

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

Closed
@rouge8

Description

@rouge8

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions