mattharrison / IllustratedPy3

Notes and issues for Illustrated Guide to Python 3
13 stars 5 forks source link

21.2 Defining a class #279

Closed mclaughlin closed 7 years ago

mclaughlin commented 7 years ago

The constructor actually takes an instance as input (the self parameter), and you can update it inside the method.

"actually" "you can update" --> "updates"

The constructor takes an instance as input (the self parameter), and updates it inside the method.

Also, a chair may hold a number of skiers, you store this in the count attribute and initialize this value to zero.

Also, a chair may hold a number of skiers—you store this value in the count attribute and initialize this value it to zero. -or- Also, a chair may hold a number of skiers; you store this value in the count attribute and initialize this value it to zero. -or- Also, a chair may hold a number of skiers. You store this value in the count attribute and initialize this value it to zero.

Note, that the constructor does not return anything, it updates values that are unique to the instance.

Same thing for these two sentences. Add "but rather" as a conjunction:

Note, that the constructor does not return anything, but rather it updates values that are unique to the instance.

Remember that a chair on a chairlift can usually hold more than one person, in this case, you said that your chair may hold up to four people.

Same for this one. Add conjunction "and":

Remember that a chair on a chairlift can usually hold more than one person, and in this case, you said that your chair may hold up to four people.

When skiers board the chair you would want to call this method on the chair. Inside of the body of the method, you update the count attribute on the instance.

Refer to the method name to be more explicit. Also it might be good to combine these last two sentences to help the flow of logic:

When skiers board the chair you would want to call the load method on the chair, and inside of the body of that method, update the count attribute on the instance.

You can also define any methods that contain actions that your instances may perform.

Remove "any". Also, I changed the end of this sentence:

You can also define any methods that contain actions that your instances may perform modify the instance of the class.

mattharrison commented 7 years ago

Oct 2