Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Reorder AppRole.map_val parameters #127

Merged
merged 3 commits into from
Aug 4, 2017
Merged

Reorder AppRole.map_val parameters #127

merged 3 commits into from
Aug 4, 2017

Conversation

skovorodkin
Copy link
Contributor

AppRole.map_val is only used by AppRole.__init__, and the latter passes dest dict as the first argument, while map_val has src as the first parameter.

It makes sense to fix map_val signature and put dest on the first place. This way we change only one line and at the same time make it to follow traditions of some other languages.


I noticed it fixing #126, but haven't checked if it's really a bug yet.

TBU.

map_val is only used by AppRole.__init__,
and the latter passes dest dict as the first argument [0],
while map_val has src as the first parameter [1].

It makes sense to fix map_val signature and put dest on the first place.
This way we change only one line
and at the same time make it to follow traditions of some other languages [2].

[0] https://github.com/Autodesk/aomi/blob/028d75307a54f69b27a53a0a349910af7e3aac47/aomi/model/auth.py#L184-L194
[1] https://github.com/Autodesk/aomi/blob/028d75307a54f69b27a53a0a349910af7e3aac47/aomi/model/auth.py#L163-L173
[2] http://lemire.me/blog/2016/09/06/function-signature-how-do-you-order-parameters/
@otakup0pe
Copy link
Contributor

Hmm this is part of the code which could really use some more test coverage... I'll take a look tonight...

@skovorodkin
Copy link
Contributor Author

I haven't checked if it's really a bug yet.

I've just checked, and, yes, bug exists and this change fixes it.

@otakup0pe otakup0pe merged commit a94aeee into Autodesk:master Aug 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants