Skip to content

Commit b686e25

Browse files
Add __slots__ to SubgraphView class
1 parent 39e5f49 commit b686e25

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

gerrychain/partition/assignment.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class Assignment(Mapping):
1717
An :class:`Assignment` has a ``parts`` property that is a dictionary of the form
1818
``{part: <frozenset of nodes in part>}``.
1919
"""
20-
__slots__ = (
20+
__slots__ = [
2121
'parts',
22-
'mapping',
23-
)
22+
'mapping'
23+
]
2424

2525
def __init__(self, parts, mapping=None, validate=True):
2626
if validate:

gerrychain/partition/subgraphs.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
class SubgraphView:
2+
__slots__ = [
3+
"graph",
4+
"parts",
5+
"subgraphs_cache"
6+
]
7+
28
def __init__(self, graph, parts):
39
self.graph = graph
410
self.parts = parts

0 commit comments

Comments
 (0)