<p>if two lines is cumbersome, you're in for a cumbersome life a programmer.</p>
<div class="gmail_quote">On Apr 22, 2013 7:31 AM, "Ram Rachum" <<a href="mailto:ram@rachum.com">ram@rachum.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi everyone,<div><br></div><div>Take a look at this question:</div><div><br></div><div><a href="http://stackoverflow.com/questions/16122435/python-3-how-do-i-use-bytes-to-bytes-and-string-to-string-encodings/16122472?noredirect=1#comment23034787_16122472" target="_blank">http://stackoverflow.com/questions/16122435/python-3-how-do-i-use-bytes-to-bytes-and-string-to-string-encodings/16122472?noredirect=1#comment23034787_16122472</a><br>


</div><div><br></div><div>Is there really no way to use base64 that's as short as:</div><div><br></div><div>    b'whatever'.encode('base64')</div><div><br></div><div>

Because doing this:</div><div><br></div><div><div>    import codecs</div><div>    codecs.decode(b"whatever", "base64_codec")</div><div><br></div><div>Or this:</div><div><br></div>

<div><div>    import base64</div><div>    encoded = base64.b64encode(b'whatever')</div><div><br></div><div>Is cumbersome!</div><div><br></div><div>Why can't I do something like b'whatever'.encode('base64')? Or maybe using a different method than `encode`?</div>


<div><br></div><div><br></div><div>Thanks,</div><div>Ram.</div></div></div></div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/ironfroggy%40gmail.com" target="_blank">http://mail.python.org/mailman/options/python-dev/ironfroggy%40gmail.com</a><br>
<br></blockquote></div>