{"id":24767,"library":"types-editdistance","title":"types-editdistance","description":"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.","status":"active","version":"0.8.0.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing-stubs","editdistance","typeshed"],"install":[{"cmd":"pip install types-editdistance","lang":"bash","label":"Install stubs via pip"},{"cmd":"pip install editdistance types-editdistance","lang":"bash","label":"Install both runtime library and stubs"}],"dependencies":[{"reason":"Typing stubs require the runtime library to be installed for actual use.","package":"editdistance","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"eval","correct":"from editdistance import eval"},{"note":"","wrong":null,"symbol":"distance","correct":"from editdistance import distance"}],"quickstart":{"code":"from editdistance import eval\nprint(eval('kitten', 'sitting'))  # Output: 3","lang":"python","description":"Compute Levenshtein distance between two strings using the `eval` function."},"warnings":[{"fix":"Use `from editdistance import eval` instead of any stub path.","message":"Do not import directly from types-editdistance; import from the runtime library `editdistance`.","severity":"gotcha","affected_versions":"all"},{"fix":"Keep both packages updated: `pip install --upgrade editdistance types-editdistance`.","message":"Stubs may lag behind the runtime library's API changes, causing false positives/negatives in type checkers.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install both: `pip install editdistance types-editdistance`. Then use `from editdistance import eval`.","cause":"Trying to import from the stub package directly instead of the runtime library.","error":"ModuleNotFoundError: No module named 'types-editdistance'"},{"fix":"Check the version: `pip show editdistance`. For older versions, use `from editdistance import distance`.","cause":"The `editdistance` library may have been updated and the function removed or renamed.","error":"Import error: cannot import name 'eval' from 'editdistance'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}