File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 4
4
*TL;DR
5
5
Traverses a container and accesses the container's elements.
6
6
"""
7
+ from __future__ import annotations
7
8
8
9
9
10
class NumberWords :
@@ -17,14 +18,14 @@ class NumberWords:
17
18
"five" ,
18
19
)
19
20
20
- def __init__ (self , start , stop ) :
21
+ def __init__ (self , start : int , stop : int ) -> None :
21
22
self .start = start
22
23
self .stop = stop
23
24
24
- def __iter__ (self ): # this makes the class an Iterable
25
+ def __iter__ (self ) -> NumberWords : # this makes the class an Iterable
25
26
return self
26
27
27
- def __next__ (self ): # this makes the class an Iterator
28
+ def __next__ (self ) -> str : # this makes the class an Iterator
28
29
if self .start > self .stop or self .start > len (self ._WORD_MAP ):
29
30
raise StopIteration
30
31
current = self .start
You can’t perform that action at this time.
0 commit comments