Skip to content

reportArgumentType error during type checking when using non-default polling_mode #77

@AndreyKuchko

Description

@AndreyKuchko

Describe the bug

It looks like there are typing issue when I use polling_mode that is different from default AutoPollingMode

To reproduce

  1. Prepare a simple script that creates client with non-defaut polling_mode(save it to file with name configcat_issue.py)
import configcatclient
from configcatclient.configcatoptions import ConfigCatOptions
from configcatclient.pollingmode import PollingMode

client = configcatclient.get(
    "my-key",
    ConfigCatOptions(polling_mode=PollingMode.lazy_load()),
)

client.close()
  1. Run type checker(for example pyright)
pyright configcat_issue.py
  1. There is an error in output
/.../configcat_issue.py
  /.../configcat_issue.py:7:35 - error: Argument of type "LazyLoadingMode" cannot be assigned to parameter "polling_mode" of type "AutoPollingMode" in function "__init__"
    "LazyLoadingMode" is not assignable to "AutoPollingMode" (reportArgumentType)
1 error, 0 warnings, 0 informations

Expected behavior

Type checker shouldn't have any errors on given script

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions