Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
📰@Botfather Officially Launches as a Mini App
The well-known bot @BotFather—the central tool for creating and managing Telegram bots—has now been made available as a Mini App.
This new feature allows users to access all of BotFather’s functionalities through an updated, interactive interface, no need to manually enter text commands.
#botfather
👉The TG Times
@nashrabot
Qué puede hacer este bot?
Impresionante bot para canales y propietarios de listas de publicidad te ayuda a crear publicaciones enriquecidas, podcasting en muchos canales
Idioma: Inglés
(visto en @BotsGram_cu)
#botfather, #token, #create, #development, #dev, #botbuilding