Re: Fwd: [numfocus] Grants up to $3k available to NumFOCUS projects, (sponsored & affiliated)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: [numfocus] Grants up to $3k available to NumFOCUS projects, (sponsored & affiliated)

Pauli Virtanen-3
Mon, 27 Mar 2017 08:21:37 -0700, Chris Barker kirjoitti:
 > On Mon, Mar 27, 2017 at 3:33 AM, Julian Taylor
 > <[hidden email]> 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
_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: [numfocus] Grants up to $3k available to NumFOCUS projects, (sponsored & affiliated)

Chris Barker - NOAA Federal
On Mon, Mar 27, 2017 at 12:14 PM, Pauli Virtanen <[hidden email]> 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

[hidden email]

_______________________________________________
NumPy-Discussion mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/numpy-discussion
Loading...