On Jan 20, 7:36 am, Steven D'Aprano <st...@remove-this- cybersource.com.au> wrote: > I have a byte string (Python 2.x string), e.g.: > > s = "g%$f yg\n1\05" > assert len(s) == 10 > > I wish to convert it to a long integer, treating it as base-256.
By the way, are you willing to divulge what you're using this functionality for? When trying to hack out the API for int.to_bytes and int.from_bytes on the mailing list and bug tracker, some of the discussion about use-cases seemed a little too much like guesswork; I'd be curious to find out about real-life use-cases. Mark -- http://mail.python.org/mailman/listinfo/python-list