Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Shiitchan can't be shittier

Name: Anonymous 2010-08-31 8:10

Discuss.

Name: Anonymous 2010-09-01 4:56

Xarn, my boy.

    if resp.getheader('Content-Encoding') == 'gzip':
        return gzip.GzipFile(fileobj=StringIO(resp.read()))
    else:
        return resp


Why would you do this? You know that the else is being taken by virtue of the control flowing to that point, making the else completely superfluous and unnecessary.

Plus, supposing you decide to change the else to an if (since we've established that else if is utterly pointless), it's possible that there's no return statement at all in the function because both of the return branches won't be taken.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List