Git Product home page Git Product logo

Comments (7)

dadadel avatar dadadel commented on July 17, 2024

Thanks @patkujawa-wf for reporting that issue. I will try to fix it ASAP.

from pyment.

dadadel avatar dadadel commented on July 17, 2024

@patkujawa-wf a first way to address your problem is to write :returns: instead of :return: as returns is the expected syntax in reST format as you can notice in the link you provided.
But the observed behaviour using your example is clearly buggy! And worth I noticed that inverting :rtype: line with :return: line will remove both lines!

from pyment.

patkujawa-wf avatar patkujawa-wf commented on July 17, 2024

Thanks @dadadel! I wonder why PyCharm autocompletes on :return:? I've definitely see that in other docstrings, too, but good to know! :)

from pyment.

patkujawa-wf avatar patkujawa-wf commented on July 17, 2024

@dadadel I'm confused, now, since http://sphinx-doc.org/domains.html#info-field-lists has an example that uses :return:, not :returns:. So which is correct?

.. py:function:: send_message(sender, recipient, message_body, [priority=1])

   Send a message to a recipient

   :param str sender: The person sending the message
   :param str recipient: The recipient of the message
   :param str message_body: The body of the message
   :param priority: The priority of the message, can be a number 1-5
   :type priority: integer or None
   :return: the message id
   :rtype: int
   :raises ValueError: if the message_body exceeds 160 characters
   :raises TypeError: if the message_body is not a basestring

from pyment.

maqifrnswa avatar maqifrnswa commented on July 17, 2024

Both are correct, return is an alias for returns:
https://github.com/sphinx-doc/sphinx/blob/2ec179044bc7dfc647731a08bc3da7d6e133c994/sphinx/domains/c.py#L69
https://github.com/sphinx-doc/sphinx/blob/5f63aac209b0d23420ddb6374673ed13dd7ec4b2/doc/ext/napoleon.rst#L110

found this while running test suites, I'll take a look at it too

edit: added pull request #28

from pyment.

dadadel avatar dadadel commented on July 17, 2024

@maqifrnswa Thanks for your fix. I updated your test commit.

from pyment.

dadadel avatar dadadel commented on July 17, 2024

The issue is fixed by the PR #28.

from pyment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.