Skip to content

Comments

Fix builtins#137

Merged
emiliom merged 8 commits intoODM2:developmentfrom
lsetiawan:fix_builtins
Jan 5, 2018
Merged

Fix builtins#137
emiliom merged 8 commits intoODM2:developmentfrom
lsetiawan:fix_builtins

Conversation

@lsetiawan
Copy link
Member

Overview

This PR addresses #115. I simply put warnings to avoid breaking the API. All older code that uses the builtin arguments should still work.

@lsetiawan lsetiawan requested a review from emiliom January 5, 2018 21:10

# Method
def getMethods(self, ids=None, codes=None, type=None):
def getMethods(self, ids=None, codes=None, medtype=None, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medtype seems like a misspelling, or else med doesn't seem like a good shorthand for "method". How about mettype or even better, full blown methodtype?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change to methodtype. This is the most clear.

a = Annotations
if type:
if type == 'action':
if 'type' in kwargs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a warning if any other kwarg is passed, besides type? ie, an unhandled/unrecognized kwarg name.

Not just in this function, but everywhere you use this scheme.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see how to best handle unrecognized kwarg

@emiliom
Copy link
Member

emiliom commented Jan 5, 2018

simply put warnings to avoid breaking the API. All older code that uses the builtin arguments should still work.

Very nice scheme!! I really like it, specially how it creates a smooth deprecation path.

I made a suggestion or two. I'll hold off on merging until you've had a chance to follow up.

Copy link
Member

@emiliom emiliom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll merge in a bit.

@emiliom
Copy link
Member

emiliom commented Jan 5, 2018

I'll merge when the CI is completed.

@emiliom emiliom merged commit 65da961 into ODM2:development Jan 5, 2018
@lsetiawan lsetiawan deleted the fix_builtins branch January 5, 2018 22:54
@lsetiawan
Copy link
Member Author

Thanks @emiliom! 👍

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.

2 participants