Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
This chat is all about kobolds and those who love them, and also own them!~ if you like those little mischievous things then you better hop in and start loving on them!~
#Chat
#Partner
https://t.me/joinchat/f7PyhKiPzrE1MGEx
Do you like beefy bois? Wanna get squeezed by some swole buff guy? Then maybe stop by this channel and oggle at all these muscled studs~
#Channel
#Partner
@snookmusclescorner
This chat is all about kobolds and those who love them, and also own them!~ if you like those little mischievous things then you better hop in and start loving on them!~
#Chat
#Partner
#NSFW
https://t.me/joinchat/f7PyhKiPzrE1MGEx
#MoveWith#Live#Workout#Partner
Join the MoveWith: Live Workout Partner beta on ✈️#TestFlight
🔗 Link: https://testflight.apple.com/join/uEXQqJ2V
Shared by Dimitri