Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
🚀 Back to Back profits are made in the Premium Group
🎯🎯#GENIUS/USDT has covered all the target to give a Profit of 167% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain
🇺🇸 Gemini joined 125+ companies urging Congress to keep the #GENIUS Act as it was written.
These parties believe that changes would undermine legal stablecoin rewards and innovation.
➖➖➖➖➖➖➖➖➖
📣@cryptonewstel
✨Vip join⭐️