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

Determine argument type automatically from default #22

Closed
jdidion opened this issue Feb 15, 2017 · 5 comments
Closed

Determine argument type automatically from default #22

jdidion opened this issue Feb 15, 2017 · 5 comments

Comments

@jdidion
Copy link

jdidion commented Feb 15, 2017

if an argument data type is not provided explicitly but a default value is:
    if default is not a tuple:
        argtype = type(default)
    elif all(type(val) == type(default[0]) for val in default[1:]):
        argtype = type(default[0])
@micheles
Copy link
Collaborator

Care to expand on that? What would be your use case?

@jdidion
Copy link
Author

jdidion commented Feb 16, 2017 via email

@micheles
Copy link
Collaborator

This is actually a good idea. I will keep it in mind, but I do not known when I will have time to work on it.

@jdidion
Copy link
Author

jdidion commented Feb 16, 2017 via email

@micheles
Copy link
Collaborator

This was actually implemented in plac 1.0, one year ago, but I forgot to close the issue.

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

No branches or pull requests

2 participants