Movatterモバイル変換


[0]ホーム

URL:


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

[1.16 regression] determining exhaustive match on an enum with type members #19151

Closed
Labels
@delfick

Description

@delfick

Hi,

I continued looking at how the codebase I work on responds to the upcoming mypy 1.16 release and I believe I found another bug

importdatetimeimportenumfromtypingimportassert_neverclassValueType(enum.Enum):BOOLEAN=boolDATE=datetime.dateDATETIME=datetime.datetimevalue_type:ValueType=ValueType.BOOLEANmatchvalue_type:caseValueType.BOOLEAN:passcaseValueType.DATE:passcaseValueType.DATETIME:passcase _:assert_never(value_type)

On mypy 1.16 I get this error

a.py:22: error: Argument 1 to "assert_never" has incompatible type "ValueType"; expected "Never"  [arg-type]

As far as I can tell this should be correct and I'm unsure why it doesn't think I have an exhaustive match.

Your Environment

  • Mypy version used: release-1.16 (revision96525a2, built locally with mypy_mypyc-wheels for cp312-macosx_arm64)
  • Mypy command-line flags:mypy a.py
  • Mypy configuration options frommypy.ini (and other config files): no config
  • Python version used: python3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp