On Mon, Jan 20, 2014 at 11:40 AM, Oscar Benjamin <oscar.j.benja...@gmail.com > wrote:
> > On Jan 20, 2014 5:21 PM, "Charles R Harris" <charlesr.har...@gmail.com> > wrote: > > On Mon, Jan 20, 2014 at 10:12 AM, Aldcroft, Thomas < > aldcr...@head.cfa.harvard.edu> wrote: > >> On Mon, Jan 20, 2014 at 10:40 AM, Oscar Benjamin < > oscar.j.benja...@gmail.com> wrote: > >>> On Mon, Jan 20, 2014 at 10:00:55AM -0500, Aldcroft, Thomas wrote: > >>> > On Mon, Jan 20, 2014 at 5:11 AM, Oscar Benjamin > >>> > >>> And why are you needing to write .decode('ascii') everywhere? > >> > >> >>> print("The first value is {}".format(bytestring_array[0])) > >> > >> On Python 2 this gives "The first value is string_value", while on > Python 3 this gives "The first value is b'string_value'". > > > > As Nathaniel has mentioned, this is a known problem with Python 3 and > the developers are trying to come up with a solution. Python 3.4 solves > some existing problems, but this one remains. It's not just numpy here, > it's that python itself needs to provide some help. > > If you think that anything in core Python will change so that you can mix > text and bytes as above then I think you are very much mistaken. If you're > referring to PEP 460/461 then you have misunderstood the purpose of those > PEPs. The authors and reviewers will carefully ensure that nothing changes > to make the above work the way that it did in 2.x. > I think we may want something like PEP 393<http://www.python.org/dev/peps/pep-0393/>. The S datatype may be the wrong place to look, we might want a modification of U instead so as to transparently get the benefit of python strings. Chuck > >
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion