mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Name this list of accepted symbol differences
This should make it easier to add new entries as well as clarifying the intent of this filter.
This commit is contained in:
@@ -73,15 +73,19 @@ class TestSetupReadline(unittest.TestCase):
|
||||
import os
|
||||
s = 'from os import '
|
||||
goal = {s + el for el in dir(os)}
|
||||
|
||||
# There are minor differences, e.g. the dir doesn't include deleted
|
||||
# items as well as items that are not only available on linux.
|
||||
difference = set(self.complete(s)).symmetric_difference(goal)
|
||||
ACCEPTED_DIFFERENCE_PREFIXES = [
|
||||
'_', 'O_', 'EX_', 'MFD_',
|
||||
'SF_', 'ST_', 'CLD_', 'POSIX_SPAWN_', 'P_',
|
||||
'RWF_', 'CLONE_', 'SCHED_',
|
||||
]
|
||||
difference = {
|
||||
x for x in difference
|
||||
if all(not x.startswith('from os import ' + s)
|
||||
for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_', 'ST_',
|
||||
'CLD_', 'POSIX_SPAWN_', 'P_', 'RWF_',
|
||||
'CLONE_', 'SCHED_'])
|
||||
if all(not x.startswith('from os import ' + prefix)
|
||||
for prefix in ACCEPTED_DIFFERENCE_PREFIXES)
|
||||
}
|
||||
# There are quite a few differences, because both Windows and Linux
|
||||
# (posix and nt) libraries are included.
|
||||
|
||||
Reference in New Issue
Block a user