Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow ellipsis default args in "trivial" non-stub functions #6665
This diff modifies the checker to allow default arguments to be used in function definitions in non-stub files as long as the body of that function is either empty or contains just a
For rationale on why this is useful, see the issue linked above.
One note on function bodies containing only a
Whitelisting only NotImplementedError seemed like a good enough compromise -- it's unlikely users will use the arguments in non-trivial ways when raising that particular exception. It should also be easy enough to relax this restriction in the future if necessary.
Sorry, returning to this only now. I added docs.
I did find writing them to be a bit difficult though: I wasn't sure exactly where to add the docs or how to best present the new info. I ended up shoving them into the page about stubs for now.
So, I'm a little leery of just landing this now. If it's not too much bother, would somebody mind doing one last sanity check over the docs I added?