Last active
October 26, 2017 04:35
-
-
Save juanarrivillaga/2f50fb93851f1818a4f10a56cbb0d187 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Record = namedtuple('Record', 'computer_name ip_address id hist_item') | |
class KeyedRecord(Record): | |
__slots__ = () | |
def __getitem__(self, item): | |
try: | |
return getattr(self,item) | |
except TypeError: | |
return super(KeyedMatch, self).__getitem__(item) | |
# row = Record(key_host, key_ips, index, hist_item) | |
# row.key_host | |
# row['key_host'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment