@@ -1122,8 +1122,7 @@ <h3 id="collection">Collection</h3>
1122
1122
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __init__</ span > < span class ="hljs-params "> (self, a)</ span > :</ span >
1123
1123
self.a = a
1124
1124
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __iter__</ span > < span class ="hljs-params "> (self)</ span > :</ span >
1125
- < span class ="hljs-keyword "> for</ span > el < span class ="hljs-keyword "> in</ span > self.a:
1126
- < span class ="hljs-keyword "> yield</ span > el
1125
+ < span class ="hljs-keyword "> return</ span > iter(self.a)
1127
1126
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __contains__</ span > < span class ="hljs-params "> (self, el)</ span > :</ span >
1128
1127
< span class ="hljs-keyword "> return</ span > el < span class ="hljs-keyword "> in</ span > self.a
1129
1128
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __len__</ span > < span class ="hljs-params "> (self)</ span > :</ span >
@@ -1139,8 +1138,7 @@ <h3 id="sequence">Sequence</h3>
1139
1138
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __init__</ span > < span class ="hljs-params "> (self, a)</ span > :</ span >
1140
1139
self.a = a
1141
1140
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __iter__</ span > < span class ="hljs-params "> (self)</ span > :</ span >
1142
- < span class ="hljs-keyword "> for</ span > el < span class ="hljs-keyword "> in</ span > self.a:
1143
- < span class ="hljs-keyword "> yield</ span > el
1141
+ < span class ="hljs-keyword "> return</ span > iter(self.a)
1144
1142
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __contains__</ span > < span class ="hljs-params "> (self, el)</ span > :</ span >
1145
1143
< span class ="hljs-keyword "> return</ span > el < span class ="hljs-keyword "> in</ span > self.a
1146
1144
< span class ="hljs-function "> < span class ="hljs-keyword "> def</ span > < span class ="hljs-title "> __len__</ span > < span class ="hljs-params "> (self)</ span > :</ span >
0 commit comments