related
related copied to clipboard
[WIP] Support any order of arguments
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?
Cool idea. I need to think about this more when I have some time.
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.
@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)