Skip to content
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

Validator for callables as parameter #650

Merged
merged 2 commits into from
Jun 21, 2017

Conversation

AdriaanRol
Copy link
Contributor

Changes proposed in this pull request:

  • A validator for callable objects
  • includes tests

@giulioungaretti

pass

def validate(self, value, context=''):
if not hasattr(value, '__call__'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to not use if not callable(value)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I'll make the change.

@jenshnielsen
Copy link
Collaborator

Looks good to me apart from a single inline comment

@AdriaanRol
Copy link
Contributor Author

@jenshnielsen , I addressed your comments, let me know what you think.

@jenshnielsen
Copy link
Collaborator

@AdriaanRol Great looks good to me

@jenshnielsen jenshnielsen merged commit 8904025 into microsoft:master Jun 21, 2017
giulioungaretti pushed a commit that referenced this pull request Jun 21, 2017
Author: Adriaan <AdriaanRol@users.noreply.github.com>

    Validator for callables as parameter (#650)
Dominik-Vogel pushed a commit to Dominik-Vogel/Qcodes that referenced this pull request Aug 9, 2017
* Validator for callables as parameter

* Addressed comment by jenshnielsen
peendebak pushed a commit to VandersypenQutech/Qcodes that referenced this pull request Aug 11, 2017
* Validator for callables as parameter

* Addressed comment by jenshnielsen
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.

None yet

2 participants