Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
TWITTER FULLY EMBRACES "THE DARK SIDE"!
If you are a #Twitter/#X "Creator" your #UserData/ID will end up in the hands of #Mossad
#AU10TIX, the company that X/Twitter uses to verify its user's ID, is an Israeli company founded by members of Israeli intelligence units #ShinBet and #Unit8200.
The CEO, Ron #Atzmon, was a member of Israel's #CyberIntelligence unit 8200. His father was once the treasurer of the #Likud, #Netanyahu's party.
AU10TIX was founded in 2002 as the technology arm of a #Dutch firm called "#ICTSInternational".
ICTS international was established in 1982 ALSO by former members of Israeli intelligence unit Shin Bet.
This is an extreme security risk.
Not only will regular creators have to give their ID to a company with deep ties to Israeli intelligence, but PRO-#PALESTINIAN creators will also have to do the same.