Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
🌍 The world’s largest atoll by land area is Kwajalein in the Marshall Islands. Its ring-shaped coral formation encloses a lagoon larger than most inland lakes and supports unique marine life. ✨
#coralreef⚡#lagoon⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
Be soft. Do not let the world make you hard. Do not let pain make you hate. Do not let the bitterness steal your sweetness. Take pride that even though the rest of the world may disagree, you still believe it to be a beautiful place..🤍
Video/Photo Créateur @konstantin.rivera 🤍
MUAH @richy_yuliana🕊
Style @olgasheremeta🦢
#chakras#mantra#mantramonday#gipsy#balance#levitation#purelove#heavenonearth#hooponopono#petitefemme#mira#moodoftheday#video#lagoon