Andrew McNamara writes: > The discussion had referred to idempotency up until that point, and I > didn't want to introduce new terminology. But referring to this: > > > generate(parse(msg)) == msg > > as "idempotency" is perfectly valid in my opinion (as in, applying an > operation multiple times produces the same result).
That would be generate(generate(msg)) == generate(msg) or parse(parse(email)) == parse(email). The input and output of these functions are of *different types*, they cannot possibly be idempotent. I'm +1 on changing to use "invertible", -0 on continuing to use "idempotent" (since it's the traditional idiom), and -1 on using "idempotent" to mean "is deterministic", ie, generate(msg) == generate(msg). If msg changes state in an irrelevant way, it would be nice to produce the same output from generate. But that is not "idempotency". And we would need to specify precisely what irrelevant means. For example, if a client of the Message class decides to specify the MIME boundary explicitly, then the output of generate has to change IMO. OTOH, many MIME implementations put the time of day or the generating process into the MIME boundary. This is unnecessary (boundaries need to be unique only message-wide, and the email package can adjust the boundary to not conflict with message content, eg, Emacs/Gnus uses something like "-=-=-=-=-" by default), and I would hope that email avoids such practices when possible. _______________________________________________ Email-SIG mailing list Email-SIG@python.org Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com