Skip to content

Commit

Permalink
DictOfNamedArrays: better repr, keys
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Feb 19, 2024
1 parent 3bdad69 commit ab24c94
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
Expand Up @@ -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)

Expand Down Expand Up @@ -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
# __iter__()/__getitem__() above.
def keys(self) -> KeysView[str]:
return self._data.keys()

# }}}

Expand Down

0 comments on commit ab24c94

Please sign in to comment.