Skip to content

Deprecate passing some conflicting arguments by keyword #80673

Closed

Description

@serhiy-storchaka
BPO 36492
Nosy @serhiy-storchaka, @tirkarthi
PRs
  • bpo-36492: Deprecate passing some arguments as keyword arguments. #12637
  • [3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) #12645
  • 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 = None
    closed_at = <Date 2019-04-01.08:00:55.255>
    created_at = <Date 2019-03-31.07:17:26.952>
    labels = ['3.8', 'type-bug', 'library']
    title = 'Deprecate passing some conflicting arguments by keyword'
    updated_at = <Date 2019-04-01.08:00:55.254>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2019-04-01.08:00:55.254>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-01.08:00:55.255>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2019-03-31.07:17:26.952>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36492
    keywords = ['patch']
    message_count = 4.0
    messages = ['339249', '339280', '339283', '339284']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'xtreak']
    pr_nums = ['12637', '12645']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue36492'
    versions = ['Python 3.8']

    Activity

    1. serhiy-storchaka commented on Mar 31, 2019

      @serhiy-storchaka
      MemberAuthor

      As Steve mentioned in the discussion about PEP-570 [1], some changes of parameters to positional-only are breaking (although there is no breaks in the stdlib code). Before making parameters positional-only we should add a deprecation warning for passing them as keyword arguments. Similarly to the code used in the UserDict constructor (see bpo-22609).

      The following PR adds deprecation warnings for other parameters which should be positional-only. It also fixes bugs about nonavailability to pass special keyword names like "self" or "func". Just one example:

      >>> import functools
      >>> def f(self, func): pass
      ... 
      >>> functools.partialmethod(f, func=chr)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: __init__() got multiple values for argument 'func'

      [1] https://discuss.python.org/t/pep-570-python-positional-only-parameters/1078/53

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 31, 2019
    3. serhiy-storchaka commented on Apr 1, 2019

      @serhiy-storchaka
      MemberAuthor

      New changeset 42a139e by Serhiy Storchaka in branch 'master':
      bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)
      42a139e

    4. serhiy-storchaka commented on Apr 1, 2019

      @serhiy-storchaka
      MemberAuthor

      New changeset a37f356 by Serhiy Storchaka in branch '3.7':
      [3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645)
      a37f356

    5. serhiy-storchaka commented on Apr 1, 2019

      @serhiy-storchaka
      MemberAuthor

      Fixes (but not deprecations) were backported to 3.7.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions