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

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

Closed
JukkaL opened this issue Nov 22, 2015 · 5 comments
Assignees
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 22, 2015

This is a follow-up to #239.

@JukkaL JukkaL added the feature label Nov 22, 2015
@gvanrossum
Copy link
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.

@JukkaL JukkaL changed the title Support dict with keyword arguments and **args Support dict with combination of positional arguments, keyword arguments and **args Nov 23, 2015
@JukkaL
Copy link
Collaborator Author

JukkaL commented Nov 23, 2015

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

@gvanrossum
Copy link
Member

Oh, the latter is probably less common?

@drewhaven
Copy link

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.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Apr 14, 2016

The discussion at #1370 (comment) is relevant.

@JukkaL JukkaL self-assigned this Apr 15, 2016
JukkaL added a commit that referenced this issue Apr 16, 2016
JukkaL added a commit that referenced this issue Apr 17, 2016
JukkaL added a commit that referenced this issue Apr 17, 2016
This is a stop-gap solution until we implement a general plugin
system for functions, or similar.

Fix #984. Also mostly fix #1010 (except for some special cases).
JukkaL added a commit that referenced this issue Apr 17, 2016
This is a stop-gap solution until we implement a general plugin
system for functions, or similar.

Fix #984. Also mostly fix #1010 (except for some special cases).
JukkaL added a commit that referenced this issue Apr 17, 2016
More work towards #984 (positional and keyword arguments for dict).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants