[Python-ideas] Adding str.isascii() ?

Terry Reedy tjreedy at udel.edu
Sat Jan 27 02:30:16 EST 2018


On 1/27/2018 2:01 AM, Guido van Rossum wrote:
> On Fri, Jan 26, 2018 at 8:22 PM, Terry Reedy 
> <tjreedy at udel.edu 
> <mailto:tjreedy at udel.edu>> wrote:
> 
>     On 1/26/2018 8:27 PM, Steven D'Aprano wrote:
> 
>         On Fri, Jan 26, 2018 at 02:37:14PM +0100, Victor Stinner wrote:
> 
> 
>             Really? I never required such check in practice. Would you
>             mind to
>             elaborate your use case?
> 
> 
>         tcl/tk and Javascript only support UCS-2 (16 bit) Unicode strings.
> 
> 
>     Since IDLE is a tkinter application, it would be helpful if there
>     were an isbmp function that exposed the existing flag in the string
>     object.
> 
> 
> Sorry, no. The existing internal flag is an implementation detail that 
> should not show in the API.

It occurred to me that this might be an issue.  Rather than define a 
LBYL scanner in Python, I think I will try wrapping inserts of 
user-supplied strings into widgets with with try: insert; except: <do 
whatever else>.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list