Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
🛍DEX aggregator from the TON Diamonds team
The team launched their Mini App of Dex Diamonds and updated the interface, now it is much more convenient and faster to “swap” tokens directly from #telegram, receiving #cashback in tokens for it ✨#GLINT.
#TonDiamondsDex achieved an impressive result — more than 100,000 transactions, and a trading turnover of $50 million, and this was achieved in 8 months.
Now there are several aggregators in the TON arena that provide a similar service. Let's see who comes out ahead!
DexDiamondsBot | Channel