On Sat, May 19, 2018 at 6:52 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> Philosophical arguments about the nature of computer memory aside, byte > objects in Python are collections of ints. > not when you start talking about bit-wise operations :-) If a "byte" in python was an integer, then we'd use b**2 rather than b << 1 (yes, I know bit shifting can be more efficient, but I don't think that's why it's there in python) The entire point of bitwise operators is so that the bits themselves can be accessed and manipulated. > If you want those ints to represent something else, you're responsible > for handling that (say, using the struct module). yup -- with struct, and, hmm, maybe bitwise operators? Anyway, as you say, this is a Philosophical (or semantic) point -- I don't think it effects the discussion at hand. However, when you talk about bit-shifting a bytes object, you do need to decide if each byte is handled individually, or if they are one big collection. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/