cpython/Python
Dennis Sweeney 80a2a4ed7d
bpo-38530: Refactor and improve AttributeError suggestions (GH-25776)
- Make case-swaps half the cost of any other edit
- Refactor Levenshtein code to not use memory allocator, and to bail early on no match.
- Add comments to Levenshtein distance code
- Add test cases for Levenshtein distance behind a debug macro
- Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`.
  - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3:
```
"Multiset Jaccard similarity" >= 2/3
matching letters / total letters >= 2/3
(name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3
1 - (2*distance) / (name_size + item_size) >= 2/3
1/3 >= (2*distance) / (name_size + item_size)
(name_size + item_size) / 6 >= distance
With rounding:
(name_size + item_size + 3) // 6 >= distance
```

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-05-03 16:47:27 +01:00
..
clinic bpo-31861: Add aiter and anext to builtins (#23847) 2021-03-23 15:47:21 -07:00
Python-ast.c bpo-43892: Make match patterns explicit in the AST (GH-25585) 2021-04-28 22:58:44 -07:00
README
_warnings.c bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
asdl.c bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933) 2021-03-23 20:47:40 +01:00
ast.c bpo-43892: Make match patterns explicit in the AST (GH-25585) 2021-04-28 22:58:44 -07:00
ast_opt.c bpo-43892: Validate the first term of complex literal value patterns (GH-25735) 2021-04-29 17:19:28 -07:00
ast_unparse.c bpo-43892: Make match patterns explicit in the AST (GH-25585) 2021-04-28 22:58:44 -07:00
bltinmodule.c bpo-43892: Make match patterns explicit in the AST (GH-25585) 2021-04-28 22:58:44 -07:00
bootstrap_hash.c bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
ceval.c bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
ceval_gil.h bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
codecs.c
compile.c bpo-43754: Fix compiler warning in Python/compile.c (GH-25855) 2021-05-03 16:20:46 +01:00
condvar.h
context.c bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
dtoa.c Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" (GH-24964) 2021-03-22 11:58:59 +01:00
dup2.c
dynamic_annotations.c
dynload_hpux.c
dynload_shlib.c
dynload_stub.c
dynload_win.c
errors.c bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) 2021-04-23 14:27:05 +01:00
fileutils.c bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096) 2021-04-30 15:21:42 +02:00
formatter_unicode.c bpo-27772: Make preceding width with 0 valid in string format. (GH-11270) 2021-01-25 11:56:33 +02:00
frozen.c bpo-43372: Use _freeze_importlib for regen-frozen. (GH-24759) 2021-03-06 13:34:03 -08:00
frozen_hello.h bpo-42739: Don't use sentinels to mark end of line table. (GH-25657) 2021-04-29 13:12:51 +01:00
frozenmain.c
future.c bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490) 2021-04-21 12:41:19 +01:00
getargs.c bpo-43321: Fix SystemError in getargs.c (GH-24656) 2021-02-27 20:31:03 +09:00
getcompiler.c closes bpo-43278: remove unnecessary leading '\n' from COMPILER when build with GCC/Clang (GH-24606) 2021-02-25 20:24:21 -08:00
getcopyright.c Bring Python into the new year. (GH-24036) 2021-01-02 00:37:23 +09:00
getopt.c
getplatform.c
getversion.c
hamt.c
hashtable.c
import.c bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243) 2021-04-07 13:01:09 +02:00
importdl.c bpo-1635741: Fix ref leak in _PyWarnings_Init() error path (GH-23151) 2020-11-04 17:33:06 +01:00
importdl.h
importlib.h bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719) 2021-04-30 14:32:47 +01:00
importlib_external.h bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
importlib_zipimport.h bpo-43933: Set frame.f_lineno during call to __exit__ (GH-25719) 2021-04-30 14:32:47 +01:00
initconfig.c bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) 2021-03-29 12:28:14 +09:00
makeopcodetargets.py
marshal.c bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586) 2020-12-01 09:56:42 +01:00
modsupport.c bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122) 2020-11-04 13:59:15 +01:00
mysnprintf.c
mystrtoul.c
opcode_targets.h bpo-43754: Eliminate bindings for partial pattern matches (GH-25229) 2021-05-02 13:02:10 -07:00
pathconfig.c bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220) 2020-11-10 21:10:22 +01:00
preconfig.c bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) 2021-03-29 12:28:14 +09:00
pyarena.c bpo-43244: Remove the pyarena.h header (GH-25007) 2021-03-24 02:23:01 +01:00
pyctype.c
pyfpe.c
pyhash.c bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493) 2021-04-22 08:34:57 -07:00
pylifecycle.c bpo-43680: _pyio.open() becomes a static method (GH-25354) 2021-04-12 10:44:53 +02:00
pymath.c
pystate.c bpo-43977: Use tp_flags for collection matching (GH-25723) 2021-04-30 09:50:28 +01:00
pystrcmp.c
pystrhex.c
pystrtod.c bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586) 2020-12-01 09:56:42 +01:00
pythonrun.c bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) 2021-04-23 14:27:05 +01:00
pytime.c bpo-37205: time.time() cannot fail with fatal error (GH-23314) 2020-11-16 16:08:05 +01:00
stdlib_module_names.h bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122) 2021-04-01 02:28:23 +02:00
structmember.c
suggestions.c bpo-38530: Refactor and improve AttributeError suggestions (GH-25776) 2021-05-03 16:47:27 +01:00
symtable.c bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583) 2021-05-03 10:43:00 +03:00
sysmodule.c bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) 2021-05-03 15:50:24 +01:00
thread.c
thread_nt.h
thread_pthread.h bpo-31904: Define THREAD_STACK_SIZE for VxWorks (GH-23718) 2020-12-09 22:47:28 +01:00
traceback.c bpo-42800: Rename AUDIT_READ to PY_AUDIT_READ (GH-25736) 2021-04-30 01:08:55 +01:00
wordcode_helpers.h

README

Miscellaneous source files for the main Python shared library