Python-language-server: False positive: inherit-non-class on Enum

Created on 7 Aug 2019  路  1Comment  路  Source: microsoft/python-language-server

This may be related to issue #1390 .

I have a false positive inherit-non-class error on the following code:

import enum
from enum import Enum


# Inheriting 'enum.Enum', which is not a class.Python(inherit-non-class)
class FooEnum(enum.Enum):
    FOO: int = 1
    BAR: int = 2


# Inheriting 'Enum', which is not a class.Python(inherit-non-class)
class BarEnum(Enum):
    FOO: int = 1
    BAR: int = 2

Related Python documentation: enum.

bug linter

Most helpful comment

That's mine. For now you can do:

"python.analysis.disabled": [
    "inherit-non-class"
],

Thanks for the report!

>All comments

That's mine. For now you can do:

"python.analysis.disabled": [
    "inherit-non-class"
],

Thanks for the report!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gramster picture gramster  路  100Comments

busykoala picture busykoala  路  29Comments

MikhailArkhipov picture MikhailArkhipov  路  46Comments

MichalPospech picture MichalPospech  路  33Comments

CaselIT picture CaselIT  路  66Comments