[Numpy-discussion] Fwd: [numfocus] Grants up to $3k available to NumFOCUS projects, (sponsored & affiliated)
Chris Barker
chris.barker at noaa.gov
Mon Mar 27 15:22:55 EDT 2017
On Mon, Mar 27, 2017 at 12:14 PM, Pauli Virtanen <pav at iki.fi> wrote:
> > The bigger challenge is deciding what to do -- the bikeshedding -- and
> > the backward incompatibility issues. IIRC, when this came up on the
> > list, there was nothing like consensus on exactly what to do and how
> > to do it.
>
> TBH, I don't see why 's' should be deprecated --- the operation is
> well-specified (byte strings + null stripping) and has the same meaning in
> python2 and 3.
>
exactly -- I don't think there was a consensus on this.
> Of course, a true 1-byte unicode subset string may be more useful type for
> some applications, so it could indeed be added.
>
That's the idea -- scientist tend to use a lot of ascii text (or at least
one-byte per char text), numy requires each element to be the same number
of bytes, so the unicode dtype is 4 btes per char -- seemingly very
wasteful.
but if you use 's' on py3, you get bytestrings back -- not "text" from a
py3 perspective.
and aside from backwards compatibility, I see no reason for a 's' dtype
that returns a bytes object on py3 -- if it's really binary data, you can
use the 'b' dtype.
-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.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170327/805519e4/attachment.html>
More information about the NumPy-Discussion
mailing list