Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support of format_string as keyword argument in string.Formatter().format() #73379

Closed
serhiy-storchaka opened this issue Jan 7, 2017 · 2 comments
Assignees
Labels
3.7 stdlib type-feature

Comments

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jan 7, 2017

BPO 29193
Nosy @serhiy-storchaka
PRs
  • #552
  • Files
  • string_formatter_positional_only.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2017-01-13.07:11:32.543>
    created_at = <Date 2017-01-07.11:35:11.513>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Remove support of format_string as keyword argument in string.Formatter().format()'
    updated_at = <Date 2017-03-31.16:36:07.881>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:07.881>
    actor = 'dstufft'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2017-01-13.07:11:32.543>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2017-01-07.11:35:11.513>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['46189']
    hgrepos = []
    issue_num = 29193
    keywords = ['patch']
    message_count = 2.0
    messages = ['284907', '285363']
    nosy_count = 2.0
    nosy_names = ['python-dev', 'serhiy.storchaka']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29193'
    versions = ['Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Jan 7, 2017

    Passing a format string as a keyword argument to string.Formatter.format() was deprecated in 3.5 (bpo-23671). 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'

    @serhiy-storchaka serhiy-storchaka added 3.7 stdlib type-feature labels Jan 7, 2017
    @serhiy-storchaka serhiy-storchaka self-assigned this Jan 13, 2017
    @python-dev
    Copy link
    Mannequin

    @python-dev python-dev mannequin commented Jan 13, 2017

    New changeset d571d8cd4258 by Serhiy Storchaka in branch 'default':
    Issue bpo-29193: A format string argument for string.Formatter.format()
    https://hg.python.org/cpython/rev/d571d8cd4258

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 stdlib type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant