From d62b386b441fb0d8f7611acb9c73d86b074b57e6 Mon Sep 17 00:00:00 2001 From: Mehul Tikekar Date: Fri, 26 Oct 2018 19:00:46 -0400 Subject: [PATCH] add unexported variables to module's __dir__ --- julia/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/julia/core.py b/julia/core.py index 2f946910..78871084 100644 --- a/julia/core.py +++ b/julia/core.py @@ -96,7 +96,12 @@ def __dir__(self): names = set() else: names = set(super(JuliaModule, self).__dir__()) - names.update(self.__all__) + + juliapath = remove_prefix(self.__name__, "julia.") + julianames = set(self._julia.eval("names({}; all=true)".format(juliapath))) + julianames.discard(juliapath.rsplit('.', 1)[-1]) + names.update(py_name(n) for n in julianames if is_accessible_name(n)) + return list(names) # Override __dir__ method so that completing member names work # well in Python REPLs like IPython.