Skip to content

Method Default Arguments #87

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

Merged
merged 4 commits into from
Aug 4, 2015
Merged

Method Default Arguments #87

merged 4 commits into from
Aug 4, 2015

Conversation

fdanny
Copy link
Contributor

@fdanny fdanny commented Aug 2, 2015

In my local code I ran into a issue with default arguments. The code in the methodbinder.bind check if the arguments given is less than the arguments needed. If it is true check if there are any default arguments if so pull the default values.

The one exception is the indexer where setter is mapped to the arguments are passed along with the value. An example T[k1, k2] = v would be passed down as a tuple like (k1,k2,v). I had to check for the default arguments in the mp_ass_subscript method before calling the SetItem.

I've included simple unit tests that tests the default argument for method calls and indexers.

@fdanny fdanny changed the title Develop Method Default Arguments Aug 2, 2015
@tonyroberts
Copy link
Contributor

Looks good! Thanks

tonyroberts added a commit that referenced this pull request Aug 4, 2015
Method Default Arguments
@tonyroberts tonyroberts merged commit d7f227e into pythonnet:develop Aug 4, 2015
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