0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 00:38:00 +01:00
cpython/Modules
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
..
_blake2 bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
_ctypes bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type (#8721) 2021-05-02 12:40:01 +02:00
_decimal bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493) 2021-04-22 08:34:57 -07:00
_io bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927) 2021-04-23 23:00:27 +01:00
_multiprocessing bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
_sha3 bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
_sqlite bpo-43434: Clean up sqlite3.connect() after GH-25818 (GH-25823) 2021-05-02 23:10:51 +01:00
_ssl bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
_xxtestfuzz Fix typo in fuzzer.c (GH-25013) 2021-03-25 00:47:21 +09:00
cjkcodecs bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
clinic bpo-18233: Add internal methods to access peer chain (GH-25467) 2021-04-26 15:01:40 +02:00
expat
_abc.c bpo-43977: Make sure that tp_flags for pattern matching are inherited correctly. (GH-25813) 2021-05-03 00:38:22 +01:00
_asynciomodule.c bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554) 2021-04-25 13:40:44 +03:00
_bisectmodule.c
_bz2module.c bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738) 2021-04-30 16:32:49 -07:00
_codecsmodule.c
_collectionsmodule.c bpo-43977: Use tp_flags for collection matching (GH-25723) 2021-04-30 09:50:28 +01:00
_contextvarsmodule.c bpo-1635741: _contextvars uses PyModule_AddType() (GH-23147) 2020-11-04 16:33:55 +01:00
_cryptmodule.c
_csv.c bpo-14935: Remove static state from the _csv module (GH-23224) 2020-12-15 15:14:35 +01:00
_curses_panel.c bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721) 2021-04-30 12:46:15 +02:00
_cursesmodule.c bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) 2021-05-03 15:50:24 +01:00
_datetimemodule.c bpo-41798: Allocate the _datetime.datetime_CAPI on the heap memory (GH-24096) 2021-01-06 20:47:19 +01:00
_dbmmodule.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_elementtree.c
_functoolsmodule.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_gdbmmodule.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_hashopenssl.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
_heapqmodule.c
_json.c bpo-42834: Fix _json internal caches for subinterpreters (GH-24121) 2021-02-01 17:26:56 +01:00
_localemodule.c bpo-42519: Replace PyMem_MALLOC() with PyMem_Malloc() (GH-23586) 2020-12-01 09:56:42 +01:00
_lsprof.c bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123) 2020-11-06 17:04:47 +01:00
_lzmamodule.c bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738) 2021-04-30 16:32:49 -07:00
_math.c
_math.h
_opcode.c
_operator.c bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
_pickle.c bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
_posixsubprocess.c bpo-28254: _posixsubprocess uses PyGC_Enable/PyGC_Disable (GH-25693) 2021-04-28 19:09:29 +02:00
_queuemodule.c bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
_randommodule.c bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
_scproxy.c
_sre.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_ssl_data_111.h bpo-43788: Generate version specific _ssl_data.h (GH-25300) 2021-04-09 08:02:00 -07:00
_ssl_data_300.h bpo-43788: Generate version specific _ssl_data.h (GH-25300) 2021-04-09 08:02:00 -07:00
_ssl_data.h
_ssl.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
_ssl.h bpo-18233: Add internal methods to access peer chain (GH-25467) 2021-04-26 15:01:40 +02:00
_stat.c
_statisticsmodule.c
_struct.c bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
_testbuffer.c bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
_testcapimodule.c bpo-28254: Add a C-API for controlling the GC state (GH-25687) 2021-04-28 18:12:16 +02:00
_testimportmultiple.c
_testinternalcapi.c bpo-38530: Refactor and improve AttributeError suggestions (GH-25776) 2021-05-03 16:47:27 +01:00
_testmultiphase.c Add _PyType_GetModuleByDef (GH-22835) 2020-11-03 22:27:12 +01:00
_threadmodule.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_tkinter.c bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721) 2021-04-30 12:46:15 +02:00
_tracemalloc.c
_uuidmodule.c
_weakref.c
_winapi.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
_xxsubinterpretersmodule.c bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721) 2021-04-30 12:46:15 +02:00
_zoneinfo.c bpo-43394: Fix -Wstrict-prototypes warnings (GH-24737) 2021-03-03 21:53:59 -08:00
addrinfo.h
arraymodule.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
atexitmodule.c bpo-43268: Pass interp rather than tstate to internal functions (GH-24580) 2021-02-19 15:10:45 +01:00
audioop.c
binascii.c
cmathmodule.c
config.c.in
errnomodule.c
faulthandler.c bpo-43268: Replace _PyThreadState_GET() with _PyInterpreterState_GET() (GH-24576) 2021-02-19 13:21:28 +01:00
fcntlmodule.c
gc_weakref.txt
gcmodule.c bpo-28254: Add a C-API for controlling the GC state (GH-25687) 2021-04-28 18:12:16 +02:00
getaddrinfo.c
getbuildinfo.c
getnameinfo.c
getpath.c bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
grpmodule.c bpo-1635741: Port grp and pwd to multiphase initialization (GH-23360) 2020-11-18 23:47:32 -08:00
hashlib.h
itertoolsmodule.c bpo-42536: GC track recycled tuples (GH-23623) 2020-12-04 19:45:57 -08:00
ld_so_aix.in
main.c Typo in comment (GH-24199) 2021-01-25 14:51:48 -08:00
makesetup
makexp_aix bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
mathmodule.c missing multiply symbol in the documentation (GH-24686) 2021-03-03 14:59:52 +01:00
md5module.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
mmapmodule.c bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927) 2021-04-23 23:00:27 +01:00
nismodule.c
ossaudiodev.c bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
overlapped.c bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
posixmodule.c bpo-43916: Remove _disabled_new() function (GH-25745) 2021-04-30 14:06:49 +02:00
posixmodule.h bpo-42655: Fix subprocess extra_groups gid conversion (GH-23762) 2020-12-29 14:58:27 +02:00
pwdmodule.c bpo-1635741: Port grp and pwd to multiphase initialization (GH-23360) 2020-11-18 23:47:32 -08:00
pyexpat.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
readline.c bpo-42819, readline: Disable bracketed paste (GH-24108) 2021-02-16 00:28:24 +01:00
README
resource.c bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251) 2021-02-18 16:26:20 +01:00
rotatingtree.c
rotatingtree.h
selectmodule.c bpo-43916: select.devpoll uses Py_TPFLAGS_DISALLOW_INSTANTIATION (GH-25751) 2021-04-30 18:19:57 +02:00
Setup bpo-40137: Add pycore_moduleobject.h internal header (GH-25507) 2021-04-22 00:52:52 +02:00
sha1module.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
sha256module.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
sha512module.c bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792) 2021-05-02 09:47:45 +02:00
signalmodule.c bpo-43963: Add _signal module state (GH-25676) 2021-04-28 03:02:55 +02:00
socketmodule.c bpo-26227: Fixes decoding of host names on Windows from ANSI instead of UTF-8 (GH-25510) 2021-04-22 00:18:20 +01:00
socketmodule.h bpo-41798: Allocate _socket module C API on the heap (GH-24126) 2021-01-06 20:43:06 +01:00
spwdmodule.c bpo-1635741: Port spwd to multiphase initialization (GH-23390) 2020-11-19 10:54:03 +01:00
sre_constants.h
sre_lib.h bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
sre.h
symtablemodule.c bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583) 2021-05-03 10:43:00 +03:00
syslogmodule.c
termios.c
testcapi_long.h
timemodule.c bpo-37205: time.time() cannot fail with fatal error (GH-23314) 2020-11-16 16:08:05 +01:00
tkappinit.c
tkinter.h
unicodedata_db.h
unicodedata.c bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748) 2021-04-30 16:04:57 +02:00
unicodename_db.h
winreparse.h
xxlimited_35.c bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151) 2021-04-02 16:48:11 +02:00
xxlimited.c bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151) 2021-04-02 16:48:11 +02:00
xxmodule.c bpo-42519: Replace PyObject_MALLOC() with PyObject_Malloc() (GH-23587) 2020-12-01 10:37:39 +01:00
xxsubtype.c
zlibmodule.c bpo-41486: Fix initial buffer size can't > UINT32_MAX in zlib module (GH-25738) 2021-04-30 16:32:49 -07:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.