Re: [Numpy-discussion] Fwd: [numfocus] Grants up to $3k available to NumFOCUS projects, (sponsored & affiliated)
Mon, 27 Mar 2017 08:21:37 -0700, Chris Barker kirjoitti:
On Mon, Mar 27, 2017 at 3:33 AM, Julian Taylor
wrote: - add ascii/latin1 dtype to support a compact python3 string array, deprecate 's' dtype which has different meaning in python2 and 3 This one is probably too big for 3k though.
probably -- but not THAT big -- it seems pretty straightforward to me.
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. Of course, a true 1-byte unicode subset string may be more useful type for some applications, so it could indeed be added. -- Pauli Virtanen
On Mon, Mar 27, 2017 at 12:14 PM, Pauli Virtanen
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@noaa.gov
participants (2)
-
Chris Barker
-
Pauli Virtanen