Comment 5 for bug 1328169

Revision history for this message
Archard Lias (archardlias) wrote :

True, in any case you get a "None". But what of being explicit about ignoring a non "None" return?

Is this case;
    log.debug("Postumous Call at Signal {0}".format(self._signal))
    ret = self.__call_signal(*args, **kwargs)
    _ = self.__call_slots(ret)
    return ret
less readable than:
    log.debug("Postumous Call at Signal {0}".format(self._signal))
    ret = self.__call_signal(*args, **kwargs)
    self.__call_slots(ret)
    return ret
?

I argue, it is less a question whether one or the other style is more correct or readable, than a matter of consistently ignoring assignments on "_", regardless of context. The individual use case is up to local conventions. Some might choose the classical, call without assignment way of formatting code, others might use the "ignorable placeholder" approach (as seen more in functional programming).

On a personal note, I do think that it "can" be more readable as well as "can be" more documenting "at times" to be explicit about ignoring a return value.

On a different note; testing unpacking ignore of
_, b = callable()
does not check the further usage of "b", ignoring everything in the assignment all together (not only "_").

Thankful for your patience,
best regards,
~arlias