Skip to content

Commit 0d6f99c

Browse files
committed
Simplify set updates with dictionary keys.
No need to generate lists of keys. No change in code function.
1 parent 6871511 commit 0d6f99c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

diffpy/srfit/equation/equationmod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __getattr__(self, name):
125125
def __dir__(self):
126126
"Return sorted list of attributes for this object."
127127
rv = set(dir(type(self)))
128-
rv.update(self.__dict__.keys() + self.argdict.keys())
128+
rv.update(self.__dict__, self.argdict)
129129
rv = sorted(rv)
130130
return rv
131131

diffpy/srfit/fitbase/parameter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def __getattr__(self, attrname):
180180
def __dir__(self):
181181
"Return sorted list of attributes for this object."
182182
rv = set(dir(type(self)))
183-
rv.update(self.__dict__.keys() + dir(self.par))
183+
rv.update(self.__dict__, dir(self.par))
184184
rv = sorted(rv)
185185
return rv
186186

diffpy/srfit/fitbase/recipeorganizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def __getattr__(self, name):
157157
def __dir__(self):
158158
"Return sorted list of attributes for this object."
159159
rv = set(dir(type(self)))
160-
rv.update(self.__dict__.keys())
160+
rv.update(self.__dict__)
161161
# self.get fetches looks up for items in all managed dictionaries.
162162
# Add keys from each dictionary in self.__managed.
163163
rv.update(*self.__managed)

0 commit comments

Comments
 (0)