-
Notifications
You must be signed in to change notification settings - Fork 103
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
Automatically move _apply() and _call() doc to __call__ #48
Comments
This is a very nice idea. I think it would go into Quite honestly this is also the last chance we have to somehow unify |
Rather into
I agree. So I suppose that would be a Actually, we could get rid of the metaclass altogether by that if I remember correctly. |
We have three cases of operators
This if we have a |
These could be reflected in the arguments to
|
Nice idea, we would need to be VERY explicit about this then. Would we enforce the naming? If so preferably only on |
If so, definitely only on |
And agreed, this would be super-explicit in the docstring, and we should add a section "How to implement and operator" in the online doc. |
I'll make a new issue for the |
This is ancient, do we work on it? |
There's still an ancient branch, but I'm not so sure how to do this reliably. I started some coding and found myself writing a docstring parser. Then I realized that it was no easy fix. Maybe it's better to just always document |
What happens to a |
Seems it links to |
That was my first thought, too, but having it point to the overridden |
Any more thoughts here? I say we close this and instead encourage users to write a short description of the operator, roughly what it does, in the class docstring. Extensive explanations in the |
I agree. |
Let's try to find out if there is a good and predictable way to move documentation from
_apply()
and_call()
ofOperator
implementations to the respective__call__()
method so it appears in the right place in the final doc. In principle, a script would for each subclass ofOperator
cls._apply.__doc__
cls.__call__.__doc__
out : something
toout : something, optional
out
is provided as argument, it is returnedcls._apply.__doc__
andcls._call.__doc__
with a hint not to use the functions directly but rather calloperator(x)
oroperator(x, out)
, respectivelyThe question is where to put this functionality. Maybe one could implement it in
Operator.__new__()
?The text was updated successfully, but these errors were encountered: