Skip to content

pre-release v0.920 incorrectly identifies enum as final #11578

Closed
@terencehonles

Description

@terencehonles

Bug Report

Mypy incorrectly identifies an enum as final. This appears related to / caused by #11247.

To Reproduce

  1. create an enum with uninitialized annotated variables and a __new__ method
  2. extend the enum with the actual values for the enum

Expected Behavior

Mypy would not complain about the enum.

Actual Behavior

error: Cannot inherit from final class "TestEnum" [misc]

Your Environment

  • Mypy version used: https://github.com/mypyc/mypy_mypyc-wheels/releases/tag/v0.920%2Bdev.89bb94a636790fc969979a47d8cb88e33a22c17e
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
    [mypy]                                                                         
    allow_redefinition = true                                                      
    disable_error_code =                                                           
        override,                                                                  
        var-annotated                                                              
    mypy_path = types/                                                             
    plugins =                                                                      
        mypy_django_plugin.main                                            
        numpy.typing.mypy_plugin,                                                  
        mypy_drf_plugin.main                                                       
    pretty = true                                                                  
    show_error_codes = true                                                        
    show_error_context = true                                                      
    warn_redundant_casts = true                                                    
    warn_unused_ignores = true                                                     
    warn_unreachable = true
    
  • Python version used: 3.10.0
  • Operating system and version: N/A

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