Code Monkey home page Code Monkey logo

Comments (8)

tasdikrahman avatar tasdikrahman commented on May 23, 2024

Didn't know about this. Will be refactoring the docstrings to conform with PEP 287. reST seems like an obvious choice here.

Thanks for pointing out 😄

from vocabulary.

gdude2002 avatar gdude2002 commented on May 23, 2024

👍 - it's not a big deal, but it's one of those useful little things that gets overlooked a lot.

from vocabulary.

tasdikrahman avatar tasdikrahman commented on May 23, 2024

Fixed in 295ee0b.

Closing issue.

from vocabulary.

balta2ar avatar balta2ar commented on May 23, 2024

:param and :returns are great but I also suggest adding :type and :rtype fields. That helps A LOT in the long run.

from vocabulary.

tasdikrahman avatar tasdikrahman commented on May 23, 2024

An example if you don't mind @balta2ar ? Would surely add it up

from vocabulary.

balta2ar avatar balta2ar commented on May 23, 2024

Something like this:

    @defer.inlineCallbacks
    def _update_models(self, cur_time,
                       new_server_stats, max_time_server):
        """
        Updates global models and models of budget objects.

        @param cur_time: Current time
        @type cur_time: datetime.datetime

        @param new_server_stats: New server stats
                (received since last update).
        @type new_server_stats: ProcessedServerStats

        @param max_time_server: Timestamp (unix timestamp) of latest
                update got from server[s].
        @type max_time_server: float

        @return: Update models running deferred.
        @rtype: defer.Deferred(dict[str, ComputationResult])
        """

from vocabulary.

gdude2002 avatar gdude2002 commented on May 23, 2024

Yuri, that isn't rst. It would be more like this:

  • :type param: str - Expected type of a parameter
  • :rtype: bool - Type/s of object/s returned by the function
    On 4 Dec 2015 15:49, "Tasdik Rahman" [email protected] wrote:

Reopened #6 #6.


Reply to this email directly or view it on GitHub
#6 (comment).

from vocabulary.

balta2ar avatar balta2ar commented on May 23, 2024

@gdude2002 Absolutely, that was just an example of type/rtype that I've grabbed from some project.

from vocabulary.

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.