-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Non-__doc__ document support #138
Comments
Oh just try! I'm still trying to improve documentation (it should be easier to do something like this). Basically you just need to alter the parser ( |
I thought I'd do it in |
I would do it at parse-time, because that's just the cleaner way. |
I disabled this a while ago, because |
Consider: some_var = object()
"""An object with unique id for XXX""" This is what I call definition of |
Well. There are quite a lot of confusions around
If you really think the name |
You can have callable factory callable_a = CallaebleFactory(a=1, b=2, c=3)
"""<docstring>"""
callable_b = CallaebleFactory(a=4, b=5, c=6)
"""<docstring>"""
callable_c = CallaebleFactory(a=7, b=8, c=9)
"""<docstring>""" In this case, what you want to know is the parameters passed to
I think the name and concept you have in mind is "half" wrong ;) There should be some function that finds (or guesses) the place of "semantic" definition of a variable (we can try to make what we mean by "semantic definition" well defined by using docstring etc. as criteria like I do above). And calling it |
So something like:
would sound reasonable? The question is if there's really much use for this if we introduce And BTW: I also removed your functionality mostly because it introduced a number of bugs. It was a quick hack (3 lines of code?), didn't work correctly for certain nested conditions. |
That is a good question. You can have something like BTW, if
Then I think most of time people use
You mean "nobody around you" ;) I think I see it place to place and I'd guess it won't be implemented otherwise. But of course I could be biased since I am using it. If we want to not implement it because "nobody use it" then we should check it if it is true in popular projects. But I'd say it is generally a good idea to make things PEP compatible. Also remember that we can use criteria other than docstring. For example, something like "if top level variable is defined by a function call (or instantiation of a class) then that call is the definition."
Oops sorry about that. Which functionality? I understand stability is more important so your choice is reasonable. |
It doesn't exist yet, it's just an idea I've wanted to share.
Yes that's my stance, too. I don't think we should be too quick changing the behavior again, since we've done that two versions again. But the discussion is definitely important.
No IDE's will probably always use
Hehe. It's not the type method we're talking about ;-) And how confusing would that be :-D
Two lines of code in
Yes it is, but PEP #257 doesn't really describe Attribute Docstrings. It's really not about that, it's about describing how to write docstrings. #258 or #224 would describe Attribute Docstrings, but they were both rejected. It's not something that the compiler recognizes or anything else of the standard library. The only reason why people are using "Attribute Docstrings" is the fact that Sphinx is recognizing them and it works very well to document them. Sphinx is big and we should care about it, but we could also check |
Agree!
Why? If we do this in current But I agree that it may not be useful all the time. And I think this is why we should have
Yes it does. What about the part I quoted in the very beginning of this issue (see above)? I didn't know both PEP258 and 224. Since it looks like PEP258 is "in" docutils and docutils (+Sphinx) is practically official docstring processor even though it is not in stdlib, I think we should assume attribute docstring is also "practically official". Besides, as I said, attribute docstring is described in PEP-257 which is not rejected.
Yea, I agree. I just didn't implement it since implementing attribute docstring was already some work. (BTW I don't like
It is about PEP here. But I agree about your argument about ecosystem. |
The only thing it says is that we call strings after statements "attribute docstrings" and even there it's in quotes. They don't give "attribute docstrings" any other meaning than "may also act as documentation". So obviously Jedi could (doesn't necessarily have to) use those docstrings for documentation purposes. This being said, we should really do some research in well known Python projects and check how much Attribute Docstrings are really used - and more importantly - where they are used. If the main use case is describing attributes for sphinx and documentation of "important" definitions, you might have a point. |
OK so you mean "PEP257 does not says Python helper tools have to parse Attribute Docstrings. Thus, not parsing Attribute Docstrings does not imply PEP257 incompatibility." Do I understand you correctly? Then, right, PEP257 does not says it is mandatory to parse it. In PEP257, parsing Attribute Docstrings is an optional specification. Maybe I should have said "it is not PEP complete" or something. Anyway this whole paragraph is a nit-picking ;)
Agree, but that would be hard. The easiest way is to ask (poll?) people, I guess. But I don't know the best place. It's much easier if Jedi has an ML. BTW, it looks like pocoo guys are using |
We've been discussing about two different things. (1) |
e.g. https://github.com/mitsuhiko/flask/blob/master/flask/helpers.py#L769
Yes, why not.
What's an ML? |
I thought there may be some discussion already. ML = mailing list |
style Documentation is exactly what I've been looking for! |
Attribute docstrings are now supported. It's been a while, but thanks again for the discussions @tkf. It helped a lot back in the days, especially the testing improvement pull requests you made. If you're ever back to the Python world, you're definitely very welcome to contribute again :). |
I suggest to support "attribute docstrings" and "additional docstrings" mentioned by PEP 257:
Sphinx autodoc also support fetching document from comment started by
#:
. This may be useful for some people.http://sphinx-doc.org/ext/autodoc.html#directive-autoattribute
I may be going to work on this issue at some point but feel free to start working on it if someone wants to do that. Also, advices on where to start is very welcome.
The text was updated successfully, but these errors were encountered: