Skip to content

E1101: Class 'HTTPMethod' has no '__members__' member (no-member) #10624

@stdedos

Description

@stdedos

Bug description

$ cat t.py 
from http import HTTPMethod

print(HTTPMethod.__members__)
$ uv run pylint t.py 
Installed 6 packages in 2ms
************* Module t
t.py:3:6: E1101: Class 'HTTPMethod' has no '__members__' member (no-member)

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

https://github.com/python/cpython/blob/8adac492d4d6f5cbff74e5250c211230e41cdbbf/Lib/http/__init__.py#L154-L180

Since Python 3.11, IIUC

Might be because of the ✨ magic ✨ @_simple_enum(StrEnum) (https://github.com/python/cpython/blob/8adac492d4d6f5cbff74e5250c211230e41cdbbf/Lib/enum.py#L1652)

Related? #4135

Configuration

Command used

uv run pylint t.py

Pylint output

************* Module t
t.py:3:6: E1101: Class 'HTTPMethod' has no '__members__' member (no-member)

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

Expected behavior

$ uv run t.py 
{'CONNECT': <HTTPMethod.CONNECT>, 'DELETE': <HTTPMethod.DELETE>, 'GET': <HTTPMethod.GET>, 'HEAD': <HTTPMethod.HEAD>, 'OPTIONS': <HTTPMethod.OPTIONS>, 'PATCH': <HTTPMethod.PATCH>, 'POST': <HTTPMethod.POST>, 'PUT': <HTTPMethod.PUT>, 'TRACE': <HTTPMethod.TRACE>}

So no error

Pylint version

$ uv run pylint --version
pylint 3.3.8
astroid 3.3.11
Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]

OS / Environment

No response

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs PRThis issue is accepted, sufficiently specified and now needs an implementationNeeds astroid Brain 🧠Needs a brain tip in astroid (then an astroid upgrade)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions