aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pkg_resources/__init__.py')
-rw-r--r--pkg_resources/__init__.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index dbdc9b04..4e4409b3 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2663,6 +2663,19 @@ class Distribution(object):
raise AttributeError(attr)
return getattr(self._provider, attr)
+ def __dir__(self):
+ return list(
+ set(super(Distribution, self).__dir__())
+ | set(
+ attr for attr in self._provider.__dir__()
+ if not attr.startswith('_')
+ )
+ )
+
+ if not hasattr(object, '__dir__'):
+ # python 2.7 not supported
+ del __dir__
+
@classmethod
def from_filename(cls, filename, metadata=None, **kw):
return cls.from_location(