<div dir="ltr">On 24 February 2013 22:08, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Mon, Feb 25, 2013 at 8:35 AM, Joshua Landau<br>
<<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:<br>
> def solve_quadratic(a, b, c):<br>
> """Solve a quadratic equation of the form ax˛ + bx + c = 0<br>
><br>
> The result will be a tuple of the two results; the results can be equal if<br>
> the determinant is 0.<br>
> This supports imaginary results for if the determinant is negative."""<br>
> ...<br>
> results = [top/(2*a) for top in fraction_tops]<br>
<br>
Yeah, I think we know which one is the more readable... Just to<br>
nit-pick a little though, that returns a list when its docstring says<br>
it'll return a tuple :)<br></blockquote><div><br></div><div style>Good catch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than that (which is probably better solved by changing the docs<br>
than the code), the only change I'd make would be to ditch the<br>
fraction_tops temporary (and to throw out some of the comments that<br>
serve only to reexpress the code that immediately follows them, though<br>
for a demo they're entirely appropriate).<br></blockquote><div><br></div><div style>I knew someone would critique it. It's an exaggerated demo for foo's sake. Heck, who even uses a function like that (or uses unicode in comments :P)?</div>

</div></div></div>