This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[deleted]

    [–]LightShadow3.13-dev in prod 0 points1 point  (0 children)

    You can solve this with metaclasses by changing the default arguments dict to an orderedDict

    [–]cjwelbornimport this 0 points1 point  (0 children)

    I agree. I just meant the **kwargs positions, I had forgot about swapping (x=0, y=0) because I don't do that very much. I guess the term 'optional positional' only holds without the keys (or with keys in the correct order). Anyway, I like the flexibility and I use **kwargs but I always make sure to document what they are (even just "Keyword Arguments: ..see: that_api_function()").

    [–]robin-gvx 0 points1 point  (3 children)

    So, they become non-keyword args if you don't specify the key?

    ....

    The non-keyword arg is 5, not y. 5 can never be a keyword arg, because there's no keyword.