Skip to content

Commit 00560e6

Browse files
committed
Get rid of intermediate dictionary and tuples
1 parent ff6e06b commit 00560e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

geoip2/records.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class Record(SimpleEquality):
2222
_valid_attributes = set()
2323

2424
def __init__(self, **kwargs):
25-
valid_args = dict((k, kwargs.get(k)) for k in self._valid_attributes)
26-
self.__dict__.update(valid_args)
25+
for k in self._valid_attributes:
26+
self.__dict__[k] = kwargs.get(k)
2727

2828
def __setattr__(self, name, value):
2929
raise AttributeError("can't set attribute")

0 commit comments

Comments
 (0)