Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More __slots__ #374

Merged
merged 2 commits into from Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions gerrychain/partition/assignment.py
Expand Up @@ -17,6 +17,10 @@ class Assignment(Mapping):
An :class:`Assignment` has a ``parts`` property that is a dictionary of the form
``{part: <frozenset of nodes in part>}``.
"""
__slots__ = [
'parts',
'mapping'
]

def __init__(self, parts, mapping=None, validate=True):
if validate:
Expand Down
6 changes: 6 additions & 0 deletions gerrychain/partition/subgraphs.py
@@ -1,4 +1,10 @@
class SubgraphView:
__slots__ = [
"graph",
"parts",
"subgraphs_cache"
]

def __init__(self, graph, parts):
self.graph = graph
self.parts = parts
Expand Down