{"id":17225778,"url":"https://github.com/atollk/flake8-typing-collections","last_synced_at":"2025-04-14T01:07:28.582Z","repository":{"id":57430016,"uuid":"289446278","full_name":"atollk/flake8-typing-collections","owner":"atollk","description":"A flake8 plugin that checks the use of suggestions made by the official documentation of the \"typing\" module.","archived":false,"fork":false,"pushed_at":"2024-06-02T08:46:49.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T01:07:21.981Z","etag":null,"topics":["flake8","flake8-extensions","flake8-plugin","python","python-types","python3","type-annotations","type-hints","typing"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atollk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-22T08:01:32.000Z","updated_at":"2024-06-02T08:45:06.000Z","dependencies_parsed_at":"2024-06-02T09:31:02.291Z","dependency_job_id":"a9fc7523-ea4c-4dcb-83f5-610e2619cd91","html_url":"https://github.com/atollk/flake8-typing-collections","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"5046007ac4efa357f888f7fcc00876c02d627605"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atollk%2Fflake8-typing-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atollk%2Fflake8-typing-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atollk%2Fflake8-typing-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atollk%2Fflake8-typing-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atollk","download_url":"https://codeload.github.com/atollk/flake8-typing-collections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804803,"owners_count":21164134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flake8","flake8-extensions","flake8-plugin","python","python-types","python3","type-annotations","type-hints","typing"],"created_at":"2024-10-15T04:14:27.643Z","updated_at":"2025-04-14T01:07:28.552Z","avatar_url":"https://github.com/atollk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flake8-typing-collections\nA flake8 plugin that checks the use of type alternatives from\nthe `typing` module over actual run time types, especially from\nthe `collections` module.\n\n## Options\n\nThe plugin offers the following flags to select which errors to enable.\nAll errors that are not explicitly enabled, are not reported.\n\n* `--tyc_generic_alt`: Enables `TYC101`, `TYC102`, `TYC103`, `TYC106`, \n`TYC107`, `TYC108`, `TYC109`, `TYC110`, `TYC111`, `TYC112`, `TYC114`, \n`TYC115`, `TYC116`, `TYC117`, `TYC118`, `TYC119`, `TYC120`, `TYC121`, \n`TYC122`, `TYC123`, `TYC124`, `TYC125`, `TYC126`, `TYC127`, `TYC128`,\n`TYC129`, `TYC130`, `TYC131`, and `TYC132`. \n* `--tyc_alias_alt`: Enables `TYC104`, `TYC105`, and `TYC113`.\n* `--tyc_general_args`: Enables `TYC200`, `TYC201`, and `TYC202`.\n\nIf none of these flags is given, the default selection is used instead,\nwhich is `--tyc_generic_alt` and `--tyc_general_args`.\n\n## Error Codes\n\n## TYC1xx class\n\nThe `typing` module defines several generic versions of built-in\nclasses, such as `typing.List[T]` instead of `list`. Their usage\nis preferred.\n\n```python\n# Good\ndef sum_list(x: List[SupportsFloat]) -\u003e float:\n    ...\n\n# Bad\ndef sum_list(x: list) -\u003e float:\n    ...\n```\n\n### TYC100\n\nUse `typing.Iterable` instead of `collections.abc.Iterable` for type annotations.\n\n\n### TYC101\n\nUse `typing.Iterator` instead of `collections.abc.Iterator` for type annotations.\n\n\n### TYC102\n\nUse `typing.Reversible` instead of `collections.abc.Reversible` for type annotations.\n\n\n### TYC103\n\nUse `typing.Container` instead of `collections.abc.Container` for type annotations.\n\n\n### TYC104\n\nUse `typing.Hashable` instead of `collections.abc.Hashable` for type annotations.\n\n\n### TYC105\n\nUse `typing.Sized` instead of `collections.abc.Sized` for type annotations.\n\n\n### TYC106\n\nUse `typing.Collection` instead of `collections.abc.Collection` for type annotations.\n\n\n### TYC107\n\nUse `typing.AbstractSet` instead of `collections.abc.Set` for type annotations.\n\n\n### TYC108\n\nUse `typing.MutableSet` instead of `collections.abc.MutableSet` for type annotations.\n\n\n### TYC109\n\nUse `typing.Mapping` instead of `collections.abc.Mapping` for type annotations.\n\n\n### TYC110\n\nUse `typing.MutableMapping` instead of `collections.abc.MutableMapping` for type annotations.\n\n\n### TYC111\n\nUse `typing.Sequence` instead of `collections.abc.Sequence` for type annotations.\n\n\n### TYC112\n\nUse `typing.MutableSequence` instead of `collections.abc.MutableSequence` for type annotations.\n\n\n### TYC113\n\nUse `typing.ByteString` instead of `bytes` for type annotations.\n\n\n### TYC114\n\nUse `typing.Deque` instead of `collections.Deque` for type annotations.\n\n\n### TYC115\n\nUse `typing.List` instead of `list` for type annotations.\n\n\n### TYC116\n\nUse `typing.Set` instead of `set` for type annotations.\n\n\n### TYC117\n\nUse `typing.FrozenSet` instead of `frozenset` for type annotations.\n\n\n### TYC118\n\nUse `typing.MappingView` instead of `collections.abc.MappingView` for type annotations.\n\n\n### TYC119\n\nUse `typing.KeysView` instead of `collections.abc.KeysView` for type annotations.\n\n\n### TYC120\n\nUse `typing.ItemsView` instead of `collections.abc.ItemsView` for type annotations.\n\n\n### TYC121\n\nUse `typing.ValuesView` instead of `collections.abc.ValuesView` for type annotations.\n\n\n### TYC122\n\nUse `typing.Awaitable` instead of `collections.abc.Awaitable` for type annotations.\n\n\n### TYC123\n\nUse `typing.Coroutine` instead of `collections.abc.Coroutine` for type annotations.\n\n\n### TYC124\n\nUse `typing.AsyncIterable` instead of `collections.abc.AsyncIterable` for type annotations.\n\n\n### TYC125\n\nUse `typing.AsyncIterator` instead of `collections.abc.AsyncIterator` for type annotations.\n\n\n### TYC126\n\nUse `typing.ContextManager` instead of `contextlib.AbstractContextManager` for type annotations.\n\n\n### TYC127\n\nUse `typing.AsyncContextManager` instead of `contextlib.AbstractAsyncContextManager` for type annotations.\n\n\n### TYC128\n\nUse `typing.Dict` instead of `dict` for type annotations.\n\n\n### TYC129\n\nUse `typing.DefaultDict` instead of `collections.defaultdict` for type annotations.\n\n\n### TYC130\n\nUse `typing.OrderedDict` instead of `collections.OrderedDict` for type annotations.\n\n\n### TYC131\n\nUse `typing.Counter` instead of `collections.Counter` for type annotations.\n\n\n### TYC132\n\nUse `typing.ChainMap` instead of `collections.ChainMap` for type annotations.\n\n\n\n\n\n\n## TYC2xx class\n\nThe documentation of the `typing` module recommends to use\nmore general types such as `typing.Sequence` over specialized\ntypes such as `typing.List` in function parameters.\n\n```python\n# Good\ndef sum_list(x: Sequence[int]) -\u003e int:\n    ...\n\n# Bad\ndef sum_list(x: List[int]) -\u003e int:\n    ...\n```\n\n### TYC200\n\nUse `typing.Sequence` or `typing.MutableSequence`\ninstead of `typing.List` in function arguments.\n\n### TYC201\n\nUse `typing.AbstractSet` or `typing.MutableSet`\ninstead of `typing.Set` in function arguments.\n\n### TYC201\n\nUse `typing.Mapping` or `typing.MutableMapping`\ninstead of `typing.Dict` in function arguments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatollk%2Fflake8-typing-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatollk%2Fflake8-typing-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatollk%2Fflake8-typing-collections/lists"}