Re: [Python-Dev] Is PEP 572 really the most effective way to solve the problems it's targeting?

2018年4月26日 04:45:16 -0700

On 2018年4月26日 20:35:20 +0900
"Stephen J. Turnbull" <[email protected]> wrote:
> Steven D'Aprano writes:
> > On Wed, Apr 25, 2018 at 09:36:31PM -0500, Ryan Gonzalez wrote: 
> 
> > > Now, what's the common theme here? **Declarations should be separate 
> from 
> > > expressions.** 
> > 
> > Declarations and assignments are not the same thing. 
> 
> Ryan mostly meant "initialization" rather than "declaration", I
> suspect. In C's for() statement, the first clause in parentheses is
> initialization, the third is assignment.
> 
> FWIW, I had been thinking the same thing (that what is really wanted
> is initialization clauses in loop statements) but had no concrete
> suggestions. Now I too have warmed to the binding expression approach
> (partly because Guido has, so I'm preparing for the inevitable :^),
> mostly because of Tim's "humorous observation" about use in printf
> debugging. The fact that there is this use case independent of block
> variable initialization (ie, in a loop or if statement) is quite
> attractive to me.
> 
> It's true, as I think Antoine pointed out, that it's easy enough to
> define a wrapper function that prints a value and returns it.
That wasn't me, but I agree with the idea anyway :-)
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to