Метод строки isidentifier() поможет узнать, подходит ли данная строка в качестве имени объекта.
Вполне может заменить самостоятельно придуманную регулярку.
>>> 'some_name'.isidentifier()
True
Обычное имя переменной
>>> '私は手紙です'.isidentifier()
True
Юникод в качестве имени тоже доступен
>>> '1_name'.isidentifier()
False
Имя не может начинаться с цифры
>>> '੬_name'.isidentifier()
False
Включая все цифры юникода
>>> 'some name'.isidentifier()
False
Пробелы недопустимы
#basic
🌍 The jet stream is a powerful, high-altitude wind that circles the planet, moving weather systems and helping shape climates on different continents thousands of kilometers apart. ✨
#atmosphere⚡#winds⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 In 2023, Cyclone Biparjoy spun over the Arabian Sea for nearly two weeks—a rare “very severe cyclonic storm” to last so long in this region, with winds impacting coasts over 1,000 kilometers apart. ✨
#cyclone⚡#disaster⚡#winds⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
H-h荒h地d之z风f- 荒地之风 Winds of the Wasteland (1936)
直达链接:https://pan.quark.cn/s/c838a322f878
#荒地之风#Winds of the Wasteland
链接:https://link3.cc/sf_com
#电影#喜剧#美国#50年代之前