[SUSPICIOUS MESSAGE] Re: Cult-like behaviour [was Re: Kindness]

Gene Heskett gheskett at shentel.net
Mon Jul 16 10:54:04 EDT 2018

On Monday 16 July 2018 10:24:28 Marko Rauhamaa wrote:

> Antoon Pardon <antoon.pardon at vub.be>:
> > I really don't understand why the author of that article didn't just
> > copy his python2 program but used sys.stdin.buffer and
> > sys.sydout.buffer instead of plain sys.stdin and stdout.
> Yes, it would be nice if you could simply restrict yourself to bytes
> everywhere when your application needed it. Unfortunately, quite many
> facilities demand text, and you will need to ponder carefully at each
> such place how you deal with encoding/decoding exceptions.
> Plus the bytes syntax is really ugly. I wish Python3 had reserved
> '...' for byte strings and "..." for UTF-32 strings.

From a lurker, that does sound usefull. The next PEP maybe?

> And just look at this:
>    AUTH_REQ = base64.b64encode(
>        ("\0{}\0{}".format(USERNAME,
> PASSWORD)).encode("latin1")).decode( "latin1")
> versus (Python2):
>    AUTH_REQ = "\0{}\0{}".format(USERNAME, PASSWORD).encode("base64")
> Marko

Cheers, Gene Heskett
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>

More information about the Python-list mailing list