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

Reject functions with required keyword-only arguments #714

Merged
merged 1 commit into from May 1, 2017

Conversation

mineo
Copy link
Member

@mineo mineo commented May 1, 2017

Python 3 / PEP3102 introduced keyword-only arguments, like in

def foo(a, *, b):
  pass

where b can't be set as a positional argument. This can't be expressed in
tagger script, so reject calls to register such functions.

This also gets rid of a DeprecationWarning for inspect.getargspec.

register_script_function(func)

def test_optional_kwonly_parameters(self):
def func(a, *, required_kwarg=1):
Copy link
Contributor

Choose a reason for hiding this comment

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

s/required_kwarg/optional_kwarg/

Python 3 / PEP3102 introduced keyword-only arguments, like in

  def foo(a, *, b):
    pass

where `b` can't be set as a positional argument. This can't be expressed in
tagger script, so reject calls to register such functions.

This also gets rid of a DeprecationWarning for inspect.getargspec.

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
@mineo mineo merged commit 05b343a into metabrainz:master May 1, 2017
mineo added a commit that referenced this pull request May 1, 2017
Reject functions with required keyword-only arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants