Skip to content

consider support python3.8 by update type hints #488

Closed
@Oaklight

Description

@Oaklight

This is an amazing project!
But I'm working on a project requires python 3.8 specifically. The PyPI page of fake-useragent 2.0.0 says it supports 3.x
Using pip install fake-useragent, it installs 2.0.0 without issue.

However, during development, I tested the code and found out type hints error stem from utils.py module:

from fake_useragent import UserAgent
  File "/home/pding/mambaforge/envs/toolregistry_3.8/lib/python3.8/site-packages/fake_useragent/__init__.py", line 4, in <module>
    from fake_useragent.fake import FakeUserAgent, UserAgent
  File "/home/pding/mambaforge/envs/toolregistry_3.8/lib/python3.8/site-packages/fake_useragent/fake.py", line 8, in <module>
    from fake_useragent.utils import BrowserUserAgentData, load
  File "/home/pding/mambaforge/envs/toolregistry_3.8/lib/python3.8/site-packages/fake_useragent/utils.py", line 42, in <module>
    def load() -> list[BrowserUserAgentData]:
TypeError: 'type' object is not subscriptable

I think this could be fixed with List[BrowserUserAgentData]. Perhaps a number of other places has this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions