Use __slots__ for fast attribute access

This commit is contained in:
Massimiliano Culpo
2022-06-07 18:07:13 +02:00
committed by Todd Gamblin
parent b6c8779772
commit 2b3f350071
2 changed files with 12 additions and 0 deletions

View File

@@ -486,6 +486,8 @@ class HashableMap(MutableMapping):
"""This is a hashable, comparable dictionary. Hash is performed on
a tuple of the values in the dictionary."""
__slots__ = 'dict',
def __init__(self):
self.dict = {}