Skip to content

Commit c6fed0c

Browse files
author
Mauko Quiroga
committed
Document EnumArray basic operations
1 parent eec85c2 commit c6fed0c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

openfisca_core/indexed_enums/enum_array.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ class EnumArray(numpy.ndarray):
4040
>>> str(enum_array)
4141
"['Tenant']"
4242
43+
>>> tuple(enum_array)
44+
(1,)
45+
46+
>>> enum_array[0]
47+
1
48+
49+
>>> enum_array[0] in enum_array
50+
True
51+
52+
>>> len(enum_array)
53+
1
54+
4355
>>> enum_array = EnumArray(list(Housing), Housing)
4456
>>> enum_array[Housing.Tenant.index]
4557
<Housing.Tenant(Tenant)>

0 commit comments

Comments
 (0)