practices-of-the-python-pro icon indicating copy to clipboard operation
practices-of-the-python-pro copied to clipboard

Issue in Ch03 greeter.py

Open bluekeybo opened this issue 4 years ago • 5 comments

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>...

bluekeybo avatar Apr 27 '20 01:04 bluekeybo

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.

daneah avatar Apr 29 '20 01:04 daneah

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().

bluekeybo avatar Apr 29 '20 01:04 bluekeybo

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.

daneah avatar Apr 29 '20 01:04 daneah

Oh yeah, once you see the code it's pretty clear. Thanks!

bluekeybo avatar Apr 29 '20 01:04 bluekeybo

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.

daneah avatar May 01 '20 16:05 daneah