-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
Reverting UndefinedLike
?
#2714
Comments
I agree that the current docstring with |
I tried the approach as suggested in #2670 in this branch: master...mattijn:altair:revert-undefinedlike, but the docstring will then look like this in google colab:
From a user perspective not yet really improving. Sorry to bother, but do you have some suggestions that might improve this @brahn / @arogozhnikov? |
@mattijn I agree it's not great! Though I think a somewhat odd docstring is more desirable than the typechecker rejecting every call, which is the problem that #2670 and #2681 address. (Let me know if you need an example of what that looks like in an IDE. It's not pretty :-) ) My sense is that the real underlying problem is the use of |
surprised that colab shows :Any in hints as that gives no useful information (just checked that pycharm hides Any from hints). Otherwise, that's a correct inferred signature, and I don't see a problem with it 🤷 |
I agree with @arogozhnikov that , though not pretty, the following is on accurate and more helpful than not. |
Thanks for the helpful feedback, let me turn the |
I agree with this. Seeing |
@joelostblom Not 100% sure I follow -- are you proposing...
If A is doable that sounds ideal! B sounds undesirable since the docstring would be prettier but is disagreeing with "the truth" about the code, and I worry that would be even more baffling. If the goal is to improve readability of the docstring I'd suggest instead adding linebreaks between the args and maybe a note explaining that |
Comment from long time ago #364:
In my understanding this means that the default argument can not be I think I favor Improving typings to a better level might already be in #2614. |
@brahn I was referring to A and I meant modifying the function signature, not the docstring as I wrote initially, sorry about the confusion caused. @mattijn Nice job digging that up. I agree with you that a solution to fix the issues for now that we can later iterate on if we want to improve the docstring styling is a good idea. Also, is this only an issue in Google Collab? I just had a look in JupyterLab with the latest master and the docstrings look great, very readable with one parameter per line. I don't see the typehints though so maybe jupyterlab does not support that yet? |
Thanks again for the comments here! Let's hope to have proper type support in the future. Moreover, if people have a strong knowledgeable opinion on this, #2614 is a good place to discuss this further. |
In #2681, we have merged the pull request that
But the result now is that the docsctrings looks like this:

I do not think we favor this behavior. Maybe #2670 was sufficient already?
Or will this make the docstrings look like:
data: Undefined = Any, encoding: Undefined = Any, etc
?The text was updated successfully, but these errors were encountered: