mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Underscored objects in stubs are not public and should never be listed
This commit is contained in:
@@ -276,6 +276,9 @@ class StubOnlyFilter(ParserTreeFilter):
|
||||
if definition.type in ('import_from', 'import_name'):
|
||||
if name.parent.type not in ('import_as_name', 'dotted_as_name'):
|
||||
return False
|
||||
n = name.value
|
||||
if n.startswith('_') and not (n.startswith('__') and n.endswith('__')):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -71,6 +71,11 @@ if os.path.isfile():
|
||||
#? ['abspath']
|
||||
fails = os.path.abspath
|
||||
|
||||
# The type vars and other underscored things from typeshed should not be
|
||||
# findable.
|
||||
#?
|
||||
os._T
|
||||
|
||||
|
||||
with open('foo') as f:
|
||||
for line in f.readlines():
|
||||
|
||||
Reference in New Issue
Block a user