# the current directory is changed with os.chdir(), an incorrect
# path will be displayed.
+import __future__
import builtins
import importlib._bootstrap
import importlib._bootstrap_external
no.append(x)
return yes, no
+_future_feature_names = set(__future__.all_feature_names)
+
def visiblename(name, all=None, obj=None):
"""Decide whether to show documentation on a variable."""
# Certain special names are redundant or internal.
# Namedtuples have public fields and methods with a single leading underscore
if name.startswith('_') and hasattr(obj, '_fields'):
return True
+ # Ignore __future__ imports.
+ if name in _future_feature_names:
+ if isinstance(getattr(obj, name, None), __future__._Feature):
+ return False
if all is not None:
# only document that which the programmer exported in __all__
return name in all