26
26
# trying the import. So __all__ is also fiddled at the end of the file.
27
27
__all__ = ["getlocale" , "getdefaultlocale" , "getpreferredencoding" , "Error" ,
28
28
"setlocale" , "resetlocale" , "localeconv" , "strcoll" , "strxfrm" ,
29
- "str" , "atof" , "atoi" , "format" , " format_string" , "currency" ,
29
+ "str" , "atof" , "atoi" , "format_string" , "currency" ,
30
30
"normalize" , "LC_CTYPE" , "LC_COLLATE" , "LC_TIME" , "LC_MONETARY" ,
31
31
"LC_NUMERIC" , "LC_ALL" , "CHAR_MAX" , "getencoding" ]
32
32
@@ -247,21 +247,6 @@ def format_string(f, val, grouping=False, monetary=False):
247
247
248
248
return new_f % val
249
249
250
- def format (percent , value , grouping = False , monetary = False , * additional ):
251
- """Deprecated, use format_string instead."""
252
- import warnings
253
- warnings .warn (
254
- "This method will be removed in a future version of Python. "
255
- "Use 'locale.format_string()' instead." ,
256
- DeprecationWarning , stacklevel = 2
257
- )
258
-
259
- match = _percent_re .match (percent )
260
- if not match or len (match .group ())!= len (percent ):
261
- raise ValueError (("format() must be given exactly one %%char "
262
- "format specifier, %s not valid" ) % repr (percent ))
263
- return _format (percent , value , grouping , monetary , * additional )
264
-
265
250
def currency (val , symbol = True , grouping = False , international = False ):
266
251
"""Formats val according to the currency settings
267
252
in the current locale."""
0 commit comments