On Wed, Apr 11, 2018 at 1:49 PM, Brendan Barnwell <brenb...@brenbarn.net> wrote:
> On 2018-04-11 05:23, Clint Hepner wrote: > >> I find the assignments make it difficult to pick out what the final >> expression looks like. >> > > I strongly agree with this, and for me I think this is enough to > push me to -1 on the whole proposal. For me the classic example case is > still the quadratic formula type of thing: > > x1, x2 = (-b + sqrt(b**2 - 4*a*c))/2, (-b - sqrt(b**2 - 4*a*c))/2 > > It just doesn't seem worth it to me to create an expression-level > assignment unless it can make things like this not just less verbose but at > the same time more readable. I don't consider this more readable: > > x1, x2 = (-b + sqrt(D := b**2 - 4*a*c)))/2, (-b - sqrt(D))/2 > <http://python.org/psf/codeofconduct/> > I'd probably write this as: x1, x2 = [(-b + s*sqrt(b**2 - 4*a*c))/(2*a) for s in (1,-1)] Agreed that the PEP doesn't really help for this use case, but I don't think it has to. The main use cases in the PEP seem compelling enough to me. Nathan
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/