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

[WIP] Support any order of arguments #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GeorgeLubaretsi
Copy link

Proposed solution for #20 for Python 3+

attrs introduced kw_only argument in 18.2.0, which will resolve any incorrect ordering issues, but we'll still need to handle this for Python 2.

@imaurer Can you help me get this PR to the finish line? Also, any proposals for handling this for Python 2?

@imaurer
Copy link
Contributor

imaurer commented Oct 13, 2018

Cool idea. I need to think about this more when I have some time.

@bhargavrpatel
Copy link

Hello -- Any updates on this? In general, we should likely expose **kwargs on all field objects. We are mentioning that Related builds off of attrs. Presumably, this implies that we are compatible with attrs. Not having key word arguments on all field methods means that are coupled to a specific functionality set of attrs.

@bhargavrpatel
Copy link

@GeorgeLubaretsi It might be better to simply change the proposed changes to allow callers to explicitly pass kwargs such that we have:

def SequenceField(cls, default=NOTHING, required=True, repr=False, key=None, **kwargs):
    # ...
    return attrib(default=default, converter=converter, validator=validator,
                  repr=repr, metadata=dict(key=key), **kwargs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants