On Mon, Nov 8, 2021 at 8:21 PM Ethan Furman <et...@stoneleaf.us> wrote: > The difference with the built-in ascii is the absence of extra quotes and the > `b` indicator when a string is used: > > ``` > >>> u_var = u'abc' > >>> bytes.ascii(u_var) > b'abc'
What about bytes, bytearray and memoryview? What is the expected behavior? I expect that memoryview is not supported (return something like b'<memory at 0x7fca8602c700>'), and that bytes and bytearray are copied without adding "b" prefix or quotes. bytes.ascii(b'abc') == b'abc' bytes.ascii(bytearray(b'abc')) == b'abc' I just suggest to elaborate the specification in the PEP. Victor -- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/3HJQPZB6QWM7IDPDU3KJ4FVY4ESJHQOK/ Code of Conduct: http://python.org/psf/codeofconduct/