<div class="gmail_quote">On Thu, Apr 9, 2009 at 6:01 AM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org">barry@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Anyway, aside from that decision, I haven't come up with an elegant way to allow /output/ in both bytes and strings (input is I think theoretically easier by sniffing the arguments).<br>
</blockquote></div><br>Won't this work? (assuming dumps() always returns a string)<br><br>def dumpb(obj, encoding='utf-8', *args, **kw):<br> s = dumps(obj, *args, **kw)<br> return s.encode(encoding)<br>
<blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>