Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
there is no str.isspecial()
#1
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.
Reply
#2
>>> import string
>>> string.punctuation
'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
Recommended Tutorials:
Reply
#3
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.
Reply
#4
Are unicode characters "special"?  They probably shouldn't be.
Reply
#5
Sͤ̑͂̽ͯ҉̩̭o̮̍ͨͬ̒̍͂m͖̤ͬͧͬe͉̹̫̓ͣͦ̋ţ̝̮̱̟̤ͣ̉̾̏į̊̍̂̋ͧm̫̜̱ẹ͈ͩ̀ͫ͒̔̈̂͢s̩̺̯͇̱ͯ̀̈̃ ̝͉̊̎̀y̛̩̽̐ͮ͑͐̃o͉̜u̱̫̲̫̩͕ͤͮͩ͑͂͞ͅ ̲͔ͪ͂̇͒͢h̩̜͑͂ͩ̎͊a̭̲ͤͩ̅̉͋͂̿ve̳͎̲̤͒ͫ̔̈̊̎ͅͅ ̭̘̜t̗̦̝͙̘̮̮ȟ͏͇̥͓͓̪̫ị̲͉͓͎ͮ̌͌͛͐ͩͮ͟s̴͖̳̺͐̒ͪͫ͋̓̉ ̷̞̜͖͖̼̻̃̍sͤtͯͤ̍͗̔͂͟r̘ͩ̌̌̅̿̽ả̱͚̬͓̭̰͋̅n̥̱̹̤̩͓ͩͣ̔ͨ̐̾g̸͖͓̯̙̭ͮ̚e̹̩͍̻̽ͅ ̶͉̖̞̔̾̐̎s̷̮͚ͬ̉́ͪͬ̈́p̣̦̃̐̇̓ͫ͂ę͇̞c̫̿͞i̖͌͌a͆̒̓ͮ͋̎̚͘l̡ͯͪ̎ͭ ̫̣̱̰̭̹č̿ͮ̓̈҉͓̖̻̥ȟ̨̬̠̗͚̈́̐̽̃͊͆ạ̴̰͍͌̾̽̎r̰̦̈̽ͥ͌̄͟a̦̪͙̻̹̩͞ͅc̈̏̚t͙̹̳̣ͮͬ̀e̝̮̩̗̪ͩ̇ͣ̉̄͆ͅr̩͌̌͊ͦs̥̳̿̈ͪ ͕̠̗͈̯ͮ̊̑̀̅f̠̠͔̟̘ͮ̑ͧ͟ṟ͍̮̤̙̰̮̊ŏ̗̤̲͋m̟̬̭͞ ̳̠̲̺͈̖ͣ̍͒o̺̓ͫ̚t̗͕̮̼̥ͧ͝ͅh̰̟͕͋̆̚͘e͔͔͙̣̳̱͇͌ͥͪ̒̇̑͝r̨͕̫ ̺̙͔ͫ̚l͓͇͔̼̲̓̓̓ͧ̚͜a̧̻̹̳͕͎͈͓ͭ̒ͣ͌ṅ͓̣͢ͅg̩̻̥̖̯̟u̜͕͉ͅa͈̻̘̪̭̙̲͛̈̾͛͘g̡̭͎̯ͬ̋ͪ̂́e͉͢s̞̺͋̈̾̓̓ͯ̈́.̶ͣ T͖̤̳̟ͯ͒̇ͯô̧͓͙̂̆ͪ͒ ̪͚͕͕̗͋f͈̬͓̓ͬͬ̈̚i̡͖̹̤͍̯̙͗̆͌̇̿̿̑l̸̥͎͉͔t͙͍̳̟͎͔ê̷̹̱̘̥̫͚̱r̗̠͛̆̓͟ ̪̩̺t͚̙̾̓̌͑̾hͣ͌̾è̞̮̔͆̈͑̚m͛̋ͦ͋̍̊ͭ҉͖̰ ̺̙͓ͬ̓͆ó͖̦͉͉͈͖u̞ṭ̳̦͙̜͆̓͢,͎̠̤͛ ͓͉̘̔̄̕ĭ͉̪͖̱͇͢s̒̌̂̔̾ͯ҉̗ ͉̘͎̃ͥ̊͒̃͜ͅn̬̗͎ͯ̈̃̂̋̀̄ȍ̟͚ͮ͐̆ͫt̤̻̩̙̪̤̋̉ͬͦ̌̓ ͨ͆͊ͬ̉ͧͤe̝̣̬̖̞̬a͍ͭͨ͋̓̄͑̀s͍͌̅̌̈̚yͬ͂.

You've also some special groups like emoticons and modifiers which have been applied on the text above @http://www.eeemo.net/
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#6
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.
Reply
#7
Don't forget multiple byte codes, utf-16le, utf-32 etc
Reply
#8
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
Reply
#9
(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.
Reply
#10
(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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020