I am probably missing something but:
dog_name=input(...)
and then later in the "case" statement:
case True:
print("Go get it!", name)
Isn't it supposed to be "dog_name" instead of "name"?
And why were PEP people so hesitant with introducing the match-case feature?
I don't think you're missing anything here, you're spot on. My guess is they changed from 'name' to 'dog_name' for clarity, then the author probably forgot to update it later in the code.
Vicki, once a manager of aircraft maintenance, is now charming Python & Ruby. She has coded OpenGates.dev, #VetsWhoCode bot, Code Questions bot, & LGBTQ of the Day Bot. They love relatable writing.
Location
Richmond, Virginia
Education
Self Taught Python/Ruby, BBA in Small Business Mgmt, AS in Production Mgmt
Vicki, once a manager of aircraft maintenance, is now charming Python & Ruby. She has coded OpenGates.dev, #VetsWhoCode bot, Code Questions bot, & LGBTQ of the Day Bot. They love relatable writing.
Location
Richmond, Virginia
Education
Self Taught Python/Ruby, BBA in Small Business Mgmt, AS in Production Mgmt
Eek. Thanks for pointing that out. I fixed the messed up naming.
I can't speculate as to why it took so long to add a match-case. I do know in PEP 3103, they claimed there was no support for such a feature. Then, PEP 635 includes rationale and some history of pattern matching. Honestly though, none of this really answers your question. These are all the official answers. I was hoping to find something more informal.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am probably missing something but:
dog_name=input(...)
and then later in the "case" statement:
case True:
print("Go get it!", name)
Isn't it supposed to be "dog_name" instead of "name"?
And why were PEP people so hesitant with introducing the match-case feature?
I don't think you're missing anything here, you're spot on. My guess is they changed from 'name' to 'dog_name' for clarity, then the author probably forgot to update it later in the code.
You are absolutely correct! I have since fixed the undefined variables.
Eek. Thanks for pointing that out. I fixed the messed up naming.
I can't speculate as to why it took so long to add a match-case. I do know in PEP 3103, they claimed there was no support for such a feature. Then, PEP 635 includes rationale and some history of pattern matching. Honestly though, none of this really answers your question. These are all the official answers. I was hoping to find something more informal.