Skip to content

Commit

Permalink
Do not index roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauko Quiroga committed Sep 16, 2021
1 parent 0810400 commit 15644b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions openfisca_core/entities/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class Role:
>>> tuple(role)
(('entity', <object object...>), ('key', 'parent'), ('plural', 'par...)
>>> role["key"]
'parent'
>>> "key" in role
True
Expand Down Expand Up @@ -104,9 +101,6 @@ def __str__(self) -> str:
def __contains__(self, item: Any) -> bool:
return item in dict(self)

def __getitem__(self, key: str) -> Any:
return dict(self)[key]

def __iter__(self) -> Iterator[Tuple[str, Any]]:
return (item for item in dataclasses.asdict(self).items())

Expand Down
6 changes: 0 additions & 6 deletions openfisca_core/types/protocols/rolifiable.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ def __contains__(self, item: Any) -> bool:

...

@abc.abstractmethod
def __getitem__(self, key: str) -> Any:
"""Has to implement :meth:`.__getitem__`."""

...

@abc.abstractmethod
def __iter__(self) -> Iterator[Tuple[str, Any]]:
"""Has to implement :meth:`.__iter__`."""
Expand Down

0 comments on commit 15644b9

Please sign in to comment.