rbt wrote:
> Is it more appropriate to do this:
>
> while 1:
>      if x:
>          return x
>
> Or this:
>
> while 1:
>      if x:
>          break
> return x
>
> Or, does it matter?

I would pick the first form if that's the only place where x would be
returned from the function. However, if there would be redundant
'return x'-es in the function because of this, then the second form
becomes preferable. It's not set in stone, though - if you have a
compelling reason to break the rule-of-thumb, do so.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to