[Python-Dev] PEP 572: Write vs Read, Understand and Control Flow
Nathaniel Smith
njs at pobox.com
Thu Apr 26 04:25:31 EDT 2018
More information about the Python-Dev mailing list
Thu Apr 26 04:25:31 EDT 2018
- Previous message (by thread): [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow
- Next message (by thread): [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Apr 25, 2018 at 11:53 PM, Chris Angelico <rosuav at gmail.com> wrote: > Well, true. The point isn't WHO you're dictating to, but that you can > dictate it at all. "Hmm, let's see. Toss a 'foo colon-equals' in front > of X, then print out what foo is." My day job involves a lot of > helping students learn how to debug, so I say this kind of thing a lot > (even if it's obvious to me what the problem is, because the student > needs to learn debugging, not just be told what to fix). Refactoring > just for the sake of a print call is overkill and potentially risky > (if the student edits the wrong thing). This is overstating things slightly... the best alternative to 'foo colon-equals' isn't risky refactoring so you can call print, it's a helper like: def p(obj): print(obj) return obj that you can sprinkle inside existing expressions. Expecting new users to realize that this is possible, and a good idea, and to implement it, and get it right, while they're in the middle of being confused about basic python things, is not terribly reasonable, so it's probably underused. But there are ways we could address that. -n -- Nathaniel J. Smith -- https://vorpus.org
- Previous message (by thread): [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow
- Next message (by thread): [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list