Функция dir() - удобна для получения списка атрибутов у любого объекта.
Ранее я писал про функцию __dir__() в модуле (не путайте её с переменной __all__(), которая указывает список объектов для импорта если встречается конструкция from module import *).
Скорее всего вы уже знаете как использовать функцию dir(). Любой объект может реализовать метод __dir__() чтобы указать список имеющийхся и динамических атрибутов. И функция dir() поможет получить список этих атрибутов.
>>> dir(str)
['__add__', '__class__', '__contains__', ...]
У этой функции есть еще один способ применения. Её можно вызвать без аргумента, и в таком случае она вернёт список имён в текущем неймспейсе.
>>> dir()
['__builtins__', '__doc__', '__file__', ...]
>>> def test():
>>> x = 1
>>> print(dir())
>>> test()
['x']
#basic#tricks
Withering soul
Little by little she dies everyday
Demons everywhere she's losing her sight
Pain has reached her bones
Breathing freely is a luxury now
she resists but she knows she is a withering soul
she is screaming but can anyone hear her?
The world's gone deaf
All eyes are shut, no one sees what's right in front of them
She is not the only one
She won't be the last one
Time is a flat circle, Nietzsche said
Once upon a time humans came into this world, cursed to repeat their doings time and time and time again
Fading souls don't await the eternal rest
There is no rest, there is no end to their agony
Trapped they are, born prisoners
Freedom was never a dream only an illusion
#review
#modern#poetry
🌈SOLD❤️ for $10,000,000. (CAN) - Located in West Vancouver Canada.
#Luxury#Modern#Mansion
📷Listed By malcolmhasman
💁Via @TheLuxuryClub
✔️🔜@R_Group_Official
━━━━━━━━━━━━━━━━━