Skip to content

Support dict with combination of positional arguments, keyword arguments and **args #984

Closed

Description

@JukkaL

This is a follow-up to #239.

Activity

  1. gvanrossum commented on Nov 23, 2015

    @gvanrossum
    Member

    Is this about the following?

        a = dict(x=1, y=2)
        b = dict(a, z=3)
    

    The first works but the second gets:

    ...: error: No overload variant of "dict" matches argument types [Any, builtins.int]
    

    I have three live occurrences of this.

  2. changed the title [-]Support dict with keyword arguments and **args[/-] [+]Support dict with combination of positional arguments, keyword arguments and **args[/+] on Nov 23, 2015
  3. JukkaL commented on Nov 23, 2015

    @JukkaL
    CollaboratorAuthor

    Yeah, that as well. I was thinking about dict(x=1, **d).

  4. gvanrossum commented on Nov 23, 2015

    @gvanrossum
    Member

    Oh, the latter is probably less common?

  5. drewhaven commented on Apr 6, 2016

    @drewhaven

    Our code has a bunch of instances of the b = dict(a, z=3) kind of constructor, using it to copy dicts with some specific values changed.

  6. added this to the milestone on Apr 6, 2016
  7. JukkaL commented on Apr 14, 2016

    @JukkaL
    CollaboratorAuthor

    The discussion at #1370 (comment) is relevant.

  8. self-assigned this
    on Apr 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions