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

 
 

bug #56606: string or unicode?

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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project 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>
Project 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5