@@ -126,17 +126,14 @@ def join(words, sep = ' '):
126126 return sep .join (words )
127127joinfields = join
128128
129- # for a little bit of speed
130- _apply = apply
131-
132129# Find substring, raise exception if not found
133130def index (s , * args ):
134131 """index(s, sub [,start [,end]]) -> int
135132
136133 Like find but raises ValueError when the substring is not found.
137134
138135 """
139- return _apply ( s .index , args )
136+ return s .index ( * args )
140137
141138# Find last substring, raise exception if not found
142139def rindex (s , * args ):
@@ -145,7 +142,7 @@ def rindex(s, *args):
145142 Like rfind but raises ValueError when the substring is not found.
146143
147144 """
148- return _apply ( s .rindex , args )
145+ return s .rindex ( * args )
149146
150147# Count non-overlapping occurrences of substring
151148def count (s , * args ):
@@ -156,7 +153,7 @@ def count(s, *args):
156153 interpreted as in slice notation.
157154
158155 """
159- return _apply ( s .count , args )
156+ return s .count ( * args )
160157
161158# Find substring, return -1 if not found
162159def find (s , * args ):
@@ -169,7 +166,7 @@ def find(s, *args):
169166 Return -1 on failure.
170167
171168 """
172- return _apply ( s .find , args )
169+ return s .find ( * args )
173170
174171# Find last substring, return -1 if not found
175172def rfind (s , * args ):
@@ -182,7 +179,7 @@ def rfind(s, *args):
182179 Return -1 on failure.
183180
184181 """
185- return _apply ( s .rfind , args )
182+ return s .rfind ( * args )
186183
187184# for a bit of speed
188185_float = float
@@ -224,7 +221,7 @@ def atoi(*args):
224221 # error message isn't compatible but the error type is, and this function
225222 # is complicated enough already.
226223 if type (s ) == _StringType :
227- return _apply ( _int , args )
224+ return _int ( * args )
228225 else :
229226 raise TypeError ('argument 1: expected string, %s found' %
230227 type (s ).__name__ )
@@ -252,7 +249,7 @@ def atol(*args):
252249 # error message isn't compatible but the error type is, and this function
253250 # is complicated enough already.
254251 if type (s ) == _StringType :
255- return _apply ( _long , args )
252+ return _long ( * args )
256253 else :
257254 raise TypeError ('argument 1: expected string, %s found' %
258255 type (s ).__name__ )
0 commit comments