Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DictOfNamedArrays: better repr, keys
Browse files Browse the repository at this point in the history
matthiasdiener committed Feb 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3bdad69 commit 9173fb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pytato/array.py
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@
import operator
import attrs
from typing import (
Optional, Callable, ClassVar, Dict, Any, Mapping, Tuple, Union,
KeysView, Optional, Callable, ClassVar, Dict, Any, Mapping, Tuple, Union,
Protocol, Sequence, cast, TYPE_CHECKING, List, Iterator, TypeVar,
FrozenSet, Collection)

@@ -817,7 +817,12 @@ def __iter__(self) -> Iterator[str]:
return iter(self._data)

def __repr__(self) -> str:
return "DictOfNamedArrays(" + str(self._data) + ")"
return "DictOfNamedArrays(" + repr(self._data) + ")"

# Note: items() and values() are not implemented here, they go through
# the __iter__()/__getitem__() above.
def keys(self) -> KeysView[str]:
return self._data.keys()

# }}}

0 comments on commit 9173fb6

Please sign in to comment.