From a8556c1007dbf7eb329caaa3dbffc9cd708359ec Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Wed, 13 Jun 2018 01:27:56 -0700 Subject: MAINT: Use a set instead of a dictionary --- numpy/core/numeric.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 7ade3d224..4ff12dbbd 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2914,15 +2914,13 @@ True_ = bool_(True) def extend_all(module): - adict = {} - for a in __all__: - adict[a] = 1 + existing = set(__all__) try: mall = getattr(module, '__all__') except AttributeError: mall = [k for k in module.__dict__.keys() if not k.startswith('_')] for a in mall: - if a not in adict: + if a not in existing: __all__.append(a) -- cgit v1.2.1