practices-of-the-python-pro
practices-of-the-python-pro copied to clipboard
Issue in Ch03 greeter.py
Why is the Greeter class including an init with name
? The specification of the Greeter class in the text above does not say to include Hi, my name is <name>...
but it says Hi, welcome to <store>...
I agree, this is a bit of a hole in the specification. Can you infer what needs to be done based on the context?
I'll add this to the errata.
The specification text under Try it out
on page 49 can be changed to add that the class needs to be initialized with the person's name and also modify the output of the greet()
method; or the code in Listing 3.3 can be changed to remove the __init__
and not print the name greeting in greet()
.
I more meant is it clear what you might need to do as a reader coding the exercise to get your code to print the Hi, my name is <name>
. The specification will certainly be updated.
Oh yeah, once you see the code it's pretty clear. Thanks!
I've noted this in errata.html
, but since this is a change on the manuscript side rather than in the code, I'll leave this open for now.