Skip to content

TypeError: type '_lru.LRU' is not subscriptable #75

@vallsv

Description

@vallsv

Hi,

I have noticed the following error with LRU, rtping to type it.
At least with Python 3.11.

import lru
_palettes: lru.LRU[int, Qt.QIcon] = lru.LRU(512)
                     ~~~~~~~^^^^^^^^^^^^^^^
TypeError: type '_lru.LRU' is not subscriptable

As work around i can do the following

from __future__ import annotations
import lru
_palettes: lru.LRU[int, Qt.QIcon] = lru.LRU(512)

But there is probably some way to implement it directly.

Are you aware of such limitation?
Would you care about supporting generic typing for your library?

Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions