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

Missing member on HTTPStatus enum instance #3296

Closed
Hawk777 opened this issue Dec 7, 2019 · 1 comment
Closed

Missing member on HTTPStatus enum instance #3296

Hawk777 opened this issue Dec 7, 2019 · 1 comment

Comments

@Hawk777
Copy link

Hawk777 commented Dec 7, 2019

Steps to reproduce

  1. Lint the code print(http.HTTPStatus(404).phrase).

Current behavior

test.py:2:6: E1101: Instance of 'HTTPStatus' has no 'phrase' member (no-member)

Expected behavior

No errors.

pylint --version output

pylint 2.4.4
astroid 2.3.3
Python 3.6.9 (default, Nov 10 2019, 00:34:23)
[GCC 9.2.0]

This looks a bit like #2950, but that was apparently fixed prior to astroid 2.3.3 (at least based on the commit date, Astroid 2.3.3 was released on November 6 while #2950 was closed on September 12, so I assume it contains the fix) and referred to accessing enum members via their named constants rather than by the constructor. It also looks a bit like #2626, but that is about methods while this is about data members; also, it seems that #2950 was fixed by making Astroid explicitly aware of HTTPStatus, whereas #2626 is about a custom enum, so it seems like a separate issue.

@PCManticore
Copy link
Contributor

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants