flake8-kotoha
KoToHa: Kaizen Type Hint
Install
uvx (Recommended)
The easiest way to run flake8 (without manually installation).
$ uvx --with flake8-kotoha flake8 .
Other options
pipx
$ pipx install --preinstall flake8-kotoha flake8
$ flake8 -h
...
Installed plugins: flake8-kotoha: 0.1.0, ...
venv + pip
$ python -m venv .venv --upgrade-deps
$ .venv/bin/python -m pip install flake8-kotoha
$ .venv/bin/flake8 -h
...
Installed plugins: flake8-kotoha: 0.1.0, ...
uv
$ uv tool install flake8 --with flake8-kotoha
$ flake8 -h
...
Installed plugins: flake8-kotoha: 0.1.0, ...
Usage
def plus_one(numbers: list[int]) -> list[int]:
return [n + 1 for n in numbers]
$ flake8 example.py
example.py:1:14: KTH101 Type hint with abstract type `collections.abc.Iterable` or `collections.abc.Sequence`, instead of concrete type `list`
Error codes
Type hints in function parameters
Use abstract types instead of concrete ones
| error code | description |
|---|---|
| KTH101 | Use Iterable or Sequence instead of list |
| KTH102 | Use Iterable or Sequence instead of tuple |
| KTH103 | Use Iterable instead of set |
| KTH104 | Use Iterable instead of dict |
Rationale
https://docs.python.org/ja/3/library/typing.html#typing.List
Note that to annotate arguments, it is preferred to use an abstract collection type such as
SequenceorIterablerather than to uselistortyping.List.
https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html#standard-duck-types
Use Iterable for generic iterables (anything usable in "
for"), and Sequence where a sequence (supporting "len" and "__getitem__") is required
https://typing.readthedocs.io/en/latest/reference/best_practices.html#arguments-and-return-types
For arguments, prefer protocols and abstract types (
Mapping,Sequence,Iterable, etc.).
Metadata
Release files for flake8-kotoha 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flake8_kotoha-0.1.1.tar.gz | 5.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_kotoha-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / flake8_kotoha-0.1.1.tar.gz
| Download URL | flake8_kotoha-0.1.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb2060fdc9db4539a96354330280883971b8144fd312f19cd34067f89fd76ead
|
|
BLAKE2b-256 checksum How to use checksums |
60f045defa8972e7104c485ef51e9fe742cacec656b24d604cb4100f7184ceca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 24, 2025.
Transparency logRelease files / flake8_kotoha-0.1.1-py3-none-any.whl
| Download URL | flake8_kotoha-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ffef53b0d0f3401e72a517d2ddfee9342b04941f60b85b148d93b5565042e0a
|
|
BLAKE2b-256 checksum How to use checksums |
8bd7f90be03883180500ce8930e0c48a59169cf0cea742d567a2c68ed05e27be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 24, 2025.
Transparency logSecurity for flake8-kotoha 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for flake8_kotoha-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 24, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.