bugpyFormex - Bugs: bug #56606, string or unicode?

 
 

bug #56606: string or unicode?

Submitter:  gianluca de santis <gianlucadesi>
Submitted:  Wed 10 Jul 2019 03:54:45 PM UTC
   
 
Category:  Plugins Severity:  2 - Minor
Item Group:  None Status:  None
Privacy:  Public Assigned to:  bverheg
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Jul 2019 01:23:54 PM UTC, comment #3: 

Has been changed in da4ee715 to not use arrays for strings.

Benedict Verhegghe <bverheg>
Group administrator
Thu 11 Jul 2019 11:59:09 AM UTC, comment #2: 

In Python3 str IS unicode. Old Python2 str is bytes.
So depending on what you want to do use either

array(b'aa')  : array of bytes
array('aa')   : array of unicode characters

But I think in most cases it is just better NOT to convert str or bytes to an array and test isinstance(...,str) or
isinstance(..., bytes).



Benedict Verhegghe <bverheg>
Group administrator
Thu 11 Jul 2019 10:06:22 AM UTC, comment #1: 

commit 83a280 (11 Jul 2019) adds a check for unicode.
Indeed, asarray('aa','bb') is an array of dtype unicode objects

gianluca de santis <gianlucadesi>
Group Member
Wed 10 Jul 2019 03:54:45 PM UTC, original submission:  

with python3 in fe_abq.py line 1374
  if e.dtype.kind != 'S':
should probably be replaced by
  if e.dtype.kind != 'U':

gianluca de santis <gianlucadesi>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by gianlucadesi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code