New submission from Serhiy Storchaka:
Passing a format string as a keyword argument to string.Formatter.format() was
deprecated in 3.5 (issue23671). Proposed patch finishes the deprecation period
and converts a warning to an error.
Python 3.5-3.6:
>>> string.Formatter().format(format_string='foo: {foo}', foo=123)
__main__:1: DeprecationWarning: Passing 'format_string' as keyword argument is
deprecated
'foo: 123'
Python 3.7:
>>> string.Formatter().format(format_string='foo: {foo}', foo=123)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/string.py", line 179, in format
"argument: 'format_string'") from None
TypeError: format() missing 1 required positional argument: 'format_string'
----------
components: Library (Lib)
files: string_formatter_positional_only.patch
keywords: patch
messages: 284907
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Remove support of format_string as keyword argument in
string.Formatter().format()
type: enhancement
versions: Python 3.7
Added file:
http://bugs.python.org/file46189/string_formatter_positional_only.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29193>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com