mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-38530: Require 50% similarity in NameError and AttributeError suggestions (GH-25584)
This commit is contained in:
parent
7244c0060d
commit
284c52da09
2 changed files with 116 additions and 1 deletions
|
@ -102,7 +102,10 @@ calculate_suggestions(PyObject *dir,
|
|||
if (current_distance == -1) {
|
||||
return NULL;
|
||||
}
|
||||
if (current_distance == 0 || current_distance > MAX_DISTANCE) {
|
||||
if (current_distance == 0 ||
|
||||
current_distance > MAX_DISTANCE ||
|
||||
current_distance * 2 > name_size)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!suggestion || current_distance < suggestion_distance) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue