Skip to content

Value of type "stat_result" should be indexable #2751

Closed
@Steap

Description

@Steap

Hello,

The following code snippet works perfectly:

import stat
import os

os.stat('/tmp')[stat.ST_MODE]

But mypy returns an error:

$ mypy bug.py 
bug.py:4: error: Value of type "stat_result" is not indexable

I believe that stat_result should be indexable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions