Terry J. Reedy added the comment: I was about to suggested a simplified version of the original one-function version but the new one is better. One change: name = lambda... is discouraged in the stdlib (Guido, pydev, a few years ago). Def statements require only 3 more chars and produce properly named objects for tracebacks. encode = lambda s: s def encode(s): return s
Under current rules, this is a 3.4 enhancement. For the context_diff and unified_diff doc change: - Compare a and b (lists of strings); + Compare string or bytes sequences a and b; # (or) + Compare a and b (both sequences of strings or sequences of bytes); Neither entry says anything at present about the type of from/tofile. Based on your patch, the following could go after the first sentence: +"Arguments *fromfile* and *tofile* are normally strings but may be bytes if the items of *a* and *b* are." ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17445> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com