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

Regression with enums #517

Closed
carmenbianca opened this issue Mar 16, 2018 · 1 comment
Closed

Regression with enums #517

carmenbianca opened this issue Mar 16, 2018 · 1 comment
Labels

Comments

@carmenbianca
Copy link

Steps to reproduce

Given the following code:

"""Docstring."""

from enum import Enum


class Person(Enum):
    """Docstring."""
    name = 'Bob'
    gender = 'Male'


print(Person.name.value.upper())

Run pylint file.py, with pylint 1.8.3 and astroid 1.6.2. The output is:

No config file found, using default configuration
************* Module file
E: 12, 6: Method 'value' has no 'upper' member (no-member)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

With astroid 1.6.1, these errors do not occur.

Current behavior

no-member errors occur.

Expected behavior

No errors occur.

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

1.6.2

@brycepg
Copy link
Contributor

brycepg commented Mar 17, 2018

Person.name.value infers [<Const.NoneType l.6 at 0x7e9e127eaef0>] in 1.6.1
but
[<Const.NoneType l.6 at 0x7f59f3f4f0b8>, <BoundMethod value of enum.Enum at 0x140024321807416] in 1.6.2

Funny through it actually should be a Const.str

@brycepg brycepg changed the title Deprecation with enums Regression with enums Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants