Ticket #6071 defect new

Opened 9 months ago

Last modified 4 weeks ago

t.i.task.react's docstring doesn't mention the reactor argument

Reported by: habnabit Owned by: reecer
Priority: normal Milestone:
Component: core Keywords: documentation easy
Cc: Branch: branches/react-reactor-arg-6071
(diff, github, buildbot, log)
Author: reecer Launchpad Bug:

Description

The docstring for t.i.task.react says:

    @param main: A callable which returns a L{Deferred}.  It should take as
        many arguments as there are elements in the list C{argv}.

But main is called as: finished = main(_reactor, *argv)

The docstring should be updated to reflect that main will be called with the reactor as an argument.

Attachments

task_docstring.patch Download (0.7 KB) - added by reecer 7 weeks ago.
Updated the docstring for the PARAM "main" to include that the PARAM _reactor is the first argument when calling "main."

Change History

1

Changed 9 months ago by habnabit

  • keywords documentation added
  • type changed from enhancement to defect

2

Changed 2 months ago by rwall

  • keywords easy added

3

Changed 7 weeks ago by reecer

  • branch_author set to reecer

Changed the docstring to the following:

    @param main: A callable which returns a L{Deferred}.  It should take as
        many arguments as there are elements in the list C{argv}. Called with 
        _reactor as first parameter.

Changed 7 weeks ago by reecer

Updated the docstring for the PARAM "main" to include that the PARAM _reactor is the first argument when calling "main."

4

Changed 7 weeks ago by itamar

  • keywords review added

Thanks for the patch! Make sure you add the "review" keyword when submitting a patch to Twisted, so we know to look at it.

5

Changed 4 weeks ago by tomprince

  • branch set to branches/react-reactor-arg-6071
  • branch_author changed from reecer to reecer, tomprince

(In [38461]) Branching to react-reactor-arg-6071.

6

Changed 4 weeks ago by tomprince

(In [38462]) Apply task_docstring.patch from reecer.

Refs: #6071.

7

Changed 4 weeks ago by tom.prince

  • keywords review removed
  • owner set to reecer
  • branch_author changed from reecer, tomprince to reecer

Thanks for your contribution, and sorry for the delay in responding to it.

Your change is an improvement on the current decription, but it still isn't entirely clear how main gets called. It should perhaps say something about taking reactor, followed by the elemnts of argv.

One thing that the current wording doesn't make clear, is that main can have optional and *args as well.

(Please submit further patches against the code in the branch)

Note: See TracTickets for help on using tickets.