Posts: 4,570
Threads: 1,469
Joined: Sep 2016
there is no str.isspecial() method that i can find. is there some short alternative?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,570
Threads: 1,469
Joined: Sep 2016
i was looking for it to see what they claimed to be special characters in python3 to see if it included any new unicode ones.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,570
Threads: 1,469
Joined: Sep 2016
there are
many unicode characters above 128 that don't fit under alphabet or numeric.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 1,298
Threads: 38
Joined: Sep 2016
Are you concerned what Python considers a special character, or what unicode (specifically utf-8) considers special?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 4,570
Threads: 1,469
Joined: Sep 2016
(Oct-05-2017, 12:44 AM)sparkz_alot Wrote: Are you concerned what Python considers a special character, or what unicode (specifically utf-8) considers special?
what Python considers a special character. if they just let it be up to unicode then, fine. i wish they would, at least, have proper tests for them, as a convenience. if they provide one class, then IMHO they should provide all classes, so there isn't a mix of sources.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,570
Threads: 1,469
Joined: Sep 2016
(Oct-05-2017, 12:37 AM)Larz60+ Wrote: Don't forget multiple byte codes, utf-16le, utf-32 etc
i didn't forget they exist.
does python3 use them for string types? the bytes types are apparently 8-bit and thus utf-8. the string type has to be using something or have some means that lets it abstract a wide range of numerical values. i wrote
this code that lets users work with these values numerically at the command line. it takes a numeric value for one character per argument and outputs the utf-8 sequence. i wrote it so i could output specific unicode in shell scripts (i can already do this in python). it includes a function named
intx()
that accepts numeric values in many base prefixes (like '0y' for base 32, ':' for base 36, '0t' for base 3, '0q' for base 4) that is used to encode digits from each argument. try this command to test it, if you have Linux.
python3 utf8.py 67 111 112 121 114 105 103 104 116 32 169 32 0x4c 0x61 :36 :3e 43 54 48 10
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.