Skip to content

Conversation

puhuk
Copy link
Contributor

@puhuk puhuk commented Sep 20, 2022

Fixes #2713

Description: To resolve mypy issue

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

@github-actions github-actions bot added the module: distributed Distributed module label Sep 20, 2022
@puhuk puhuk changed the title Update native.py Resolve issue #2713 Sep 20, 2022
init_method: Optional[str] = None,
world_size: Optional[int] = None,
rank: Optional[int] = None,
timeout: Optional[Union[Any, int]] = None,
Copy link
Collaborator

@vfdev-5 vfdev-5 Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Union of Any and int looks weird here. It means that timeout is either any kind of object or int which is also included in Any.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Sep 20, 2022

@puhuk thanks for the PR, however a fix can be much more easy as in #2717.
As init_pg_kwargs was defined as {}, mypy details its type (Dict[what?, what?]) from the first entry: init_pg_kwargs["timeout"] = timeout so it becomes Dict[str, int] but this type is wrong.

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Sep 20, 2022

Closing in favor of #2717

@vfdev-5 vfdev-5 closed this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: distributed Distributed module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypy issue on master
2 participants