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

@api_default macro removes line info #151

Open
KristofferC opened this issue Nov 7, 2019 · 2 comments
Open

@api_default macro removes line info #151

KristofferC opened this issue Nov 7, 2019 · 2 comments

Comments

@KristofferC
Copy link
Collaborator

julia> m = @which GitHub.pull_request(Repo("JuliaLang/julia"), 33779)
pull_request(repo, pr) in GitHub

In general, the '@api_default` is pretty annoying. It needs to be put on all methods and I don't see how it is better than just using a global or a keyword arg with a default value or something more normal.

@simonbyrne
Copy link
Collaborator

My guess is that it's because it's the first argument, so writing these is somewhat cumbersome?

On a somewhat related note, I would actually like to change the interface so that auth and headers are included as part of the GitHubAPI object (since they tend not to change between requests). In which case we could make it non-optional?

@KristofferC
Copy link
Collaborator Author

The argument got introduced at the same time as the macro though.

Yeah, writing auth all the time (and then forgetting it somewhere causing rate limits sometimes) is also kinda annoying.

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