Skip to content

Mypy error: Function has duplicate type signatures #21307

Description

@damiondoesthings
  • Package Name: azure-storage-file-share
  • Package Version: 12.6.0
  • Operating System: Mac OS 11.6 / ubuntu-18.04
  • Python Version: 3.8

Describe the bug
Duplicate type information causes type checker to fail.
mypy 0.910 will fail with output azure/storage/fileshare/_file_client.py:684: error: Function has duplicate type signatures

To Reproduce
Steps to reproduce the behavior:

  1. call the download_file() function on a FileClient in a python file
  2. create mypy.ini with [mypy-azure.storage.fileshare.*]] ignore_missing_imports = True
  3. run mypy on the python file

Expected behavior
Mypy should find no errors in the Azure fileshare package.

Additional context
This is caused by types in the download_file function being specified twice:

    def download_file(
            self, offset=None,  # type: Optional[int]
            length=None,  # type: Optional[int]
            **kwargs
        ):
        # type: (Optional[int], Optional[int], Any) -> StorageStreamDownloader```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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