Skip to content

Commit 15644b9

Browse files
author
Mauko Quiroga
committed
Do not index roles
1 parent 0810400 commit 15644b9

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

openfisca_core/entities/role.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ class Role:
6060
>>> tuple(role)
6161
(('entity', <object object...>), ('key', 'parent'), ('plural', 'par...)
6262
63-
>>> role["key"]
64-
'parent'
65-
6663
>>> "key" in role
6764
True
6865
@@ -104,9 +101,6 @@ def __str__(self) -> str:
104101
def __contains__(self, item: Any) -> bool:
105102
return item in dict(self)
106103

107-
def __getitem__(self, key: str) -> Any:
108-
return dict(self)[key]
109-
110104
def __iter__(self) -> Iterator[Tuple[str, Any]]:
111105
return (item for item in dataclasses.asdict(self).items())
112106

openfisca_core/types/protocols/rolifiable.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ def __contains__(self, item: Any) -> bool:
5353

5454
...
5555

56-
@abc.abstractmethod
57-
def __getitem__(self, key: str) -> Any:
58-
"""Has to implement :meth:`.__getitem__`."""
59-
60-
...
61-
6256
@abc.abstractmethod
6357
def __iter__(self) -> Iterator[Tuple[str, Any]]:
6458
"""Has to implement :meth:`.__iter__`."""

0 commit comments

Comments
 (0)