File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1101,6 +1101,8 @@ class MySortable:
1101
1101
```
1102
1102
1103
1103
### Iterator
1104
+ * ** Next() should return next item or raise 'StopIteration'.**
1105
+ * ** Iter() should return 'self'.**
1104
1106
``` python
1105
1107
class Counter :
1106
1108
def __init__ (self ):
@@ -1205,7 +1207,7 @@ class MyCollection:
1205
1207
```
1206
1208
1207
1209
### Sequence
1208
- * ** Only required methods are len() and getitem().**
1210
+ * ** Only required methods are len() and getitem(), that should return an item at index or raise 'IndexError' .**
1209
1211
* ** Iter() and contains() automatically work on any object that has getitem() defined.**
1210
1212
* ** Reversed() automatically works on any object that has getitem() and len() defined.**
1211
1213
``` python
Original file line number Diff line number Diff line change @@ -1034,6 +1034,10 @@ <h3 id="sortable">Sortable</h3>
1034
1034
< span class ="hljs-keyword "> return</ span > < span class ="hljs-built_in "> NotImplemented</ span >
1035
1035
</ code > </ pre >
1036
1036
< h3 id ="iterator-1 "> Iterator</ h3 >
1037
+ < ul >
1038
+ < li > < strong > Next() should return next item or raise 'StopIteration'.</ strong > </ li >
1039
+ < li > < strong > Iter() should return 'self'.</ strong > </ li >
1040
+ </ ul >
1037
1041
< pre > < code class ="python language-python hljs "> < span class ="hljs-class "> < span class ="hljs-keyword "> class</ span > < span class ="hljs-title "> Counter</ span > :</ span >
1038
1042
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __init__</ span > < span class ="hljs-params "> (self)</ span > :</ span >
1039
1043
self.i = < span class ="hljs-number "> 0</ span >
@@ -1120,7 +1124,7 @@ <h3 id="collection">Collection</h3>
1120
1124
</ code > </ pre >
1121
1125
< h3 id ="sequence "> Sequence</ h3 >
1122
1126
< ul >
1123
- < li > < strong > Only required methods are len() and getitem().</ strong > </ li >
1127
+ < li > < strong > Only required methods are len() and getitem(), that should return an item at index or raise 'IndexError' .</ strong > </ li >
1124
1128
< li > < strong > Iter() and contains() automatically work on any object that has getitem() defined.</ strong > </ li >
1125
1129
< li > < strong > Reversed() automatically works on any object that has getitem() and len() defined.</ strong > </ li >
1126
1130
</ ul >
You can’t perform that action at this time.
0 commit comments