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 44*TL;DR
55Traverses a container and accesses the container's elements.
66"""
7+ from __future__ import annotations
78
89
910class NumberWords :
@@ -17,14 +18,14 @@ class NumberWords:
1718 "five" ,
1819 )
1920
20- def __init__ (self , start , stop ) :
21+ def __init__ (self , start : int , stop : int ) -> None :
2122 self .start = start
2223 self .stop = stop
2324
24- def __iter__ (self ): # this makes the class an Iterable
25+ def __iter__ (self ) -> NumberWords : # this makes the class an Iterable
2526 return self
2627
27- def __next__ (self ): # this makes the class an Iterator
28+ def __next__ (self ) -> str : # this makes the class an Iterator
2829 if self .start > self .stop or self .start > len (self ._WORD_MAP ):
2930 raise StopIteration
3031 current = self .start
You can’t perform that action at this time.
0 commit comments