twisted / twisted/twisted

Confusing (and possibly unnecessary) change of timeOut from class-, to instance- variable makes example code more difficult to follow.

Open
#6,845 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation new priority-low trial
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

Zancas's avatar Zancas reported
Trac ID trac#6845
Type defect
Created 2013-11-18 23:22:07Z

In the trial howto document:

https://twistedmatrix.com/documents/current/core/howto/trial.html#auto9

In the section on scheduling, in the example code:

listings/trial/calculus/client_2.py

"the variable "timeOut" is set as a class variable in "RemoteCalculationClient".

Later in the "Resolve a bug" section:

https://twistedmatrix.com/documents/current/core/howto/trial.html#auto12

in the closely related example code:

listings/trial/calculus/client_3.py

the instance variable "self._timeOut = 60" is assigned in the same class's init.

While both examples are coherent and produce the expected test errors/passes, the change of assignment scope for the timeOut variable is question begging, and potentially distracting from the point of the examples.

Since the variable is not assigned to elsewhere, perhaps it should remain a class variable?

Alternatively, or additionally, a mention of the change, and a justification in the expository text might help prevent confusion.

Searchable metadata
trac-id__6845 6845
type__defect defect
reporter__Zancas Zancas
priority__low low
milestone__ 
branch__ 
branch_author__ 
status__new new
resolution__None None
component__trial trial
keywords__documentation documentation
time__1384816927000000 1384816927000000
changetime__1384816928000000 1384816928000000
version__None None
owner__ 
cc__jml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the scheduling and “Resolve a bug” sections of the Trial howto, then compare listings/trial/calculus/client_2.py with listings/trial/calculus/client_3.py. Determine whether the timeOut scope change should be made consistent or explained in the documentation, and verify that the examples and related tests still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.