types-editdistance
raw JSON → 0.8.0.20260408 verified Fri May 01 auth: no python
Typing stubs for the `editdistance` library, providing type hints for functions like `eval()`. Version 0.8.0.20260408 targets Python 3.10+. These stubs are part of typeshed and are auto-generated, so they track the underlying `editdistance` API. Release cadence is tied to typeshed updates.
pip install types-editdistance Common errors
error ModuleNotFoundError: No module named 'types-editdistance' ↓
cause Trying to import from the stub package directly instead of the runtime library.
fix
Install both:
pip install editdistance types-editdistance. Then use from editdistance import eval. error Import error: cannot import name 'eval' from 'editdistance' ↓
cause The `editdistance` library may have been updated and the function removed or renamed.
fix
Check the version:
pip show editdistance. For older versions, use from editdistance import distance. Warnings
gotcha Do not import directly from types-editdistance; import from the runtime library `editdistance`. ↓
fix Use `from editdistance import eval` instead of any stub path.
gotcha Stubs may lag behind the runtime library's API changes, causing false positives/negatives in type checkers. ↓
fix Keep both packages updated: `pip install --upgrade editdistance types-editdistance`.
Install
pip install editdistance types-editdistance Imports
- eval
from editdistance import eval - distance
from editdistance import distance
Quickstart
from editdistance import eval
print(eval('kitten', 'sitting')) # Output: 3