Функция 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
🚨*ATTENTION*
*The British chapter of the Antifascist International* calls on the oppressed of the world to stand firmly with Venezuelan 🇻🇪 sovereignty and to denounce *UK complicity* in the imperialist war against *Venezuela*.
All out! Join us!
🗓 10 January ⏰ 1:00pm
🏢 Downing Street
🥁 Bring noise, flags, banners!!
#HandsOffVenezuela
https://antifascistinternational.uk/solidarity-with-the-people-of-the-bolivarian-republic-of-venezuela-and-president-nicolas-maduro-moros/
Erklärung der DKP zu den US-Angriffen gegen Venezuela!
Jetzt lesen unter unsere-zeit.de/haende-weg-von-venezuela-3-4810421/
#handsoffvenezuela#venezuela#usa
Responding to a call from the International People's Assembly, ALBA Movimientos, The Simon Bolivar Institute and The Assembly of Caribbean Peoples, activists worldwide rallied against US intervention in Venezuela and supported its recent presidential election.
From Kinshasa to Seoul, Rome to Luanda, and beyond, demonstrations defended Venezuelan democracy and sovereignty. In cities like Oslo, Vigo, and Pretoria, participants voiced solidarity with the Venezuelan people and the Bolivarian Government and condemned fascism and imperialist actions.
Click here to view the full gallery 👉🏼https://shorturl.at/YV7b0
#handsoffVenezuela#Venezuela#solidarity#internationalpeoplesassembly
🇺🇸🕊️El imperio no habla por su pueblo
⚡️Mientras Trump escala su agresión contra Venezuela, crece la resistencia interna en Estados Unidos. Organizaciones pacifistas protestaron frente al Congreso para denunciar la larga historia de intervenciones ilegales impulsadas desde la Casa Blanca.
📄 Respaldados por más de 15.000firmas, los activistas exigieron apoyo a la Resolución Constitucional 68, que ordena retirar a las Fuerzas Armadas de EE.UU. de Venezuela por carecer de aval legislativo.
👉 Incluso dentro de EE.UU., la guerra pierde legitimidad.
#NoALaGuerra
#TrumpAgresor
#VenezuelaResiste
#PuebloDeEEUUContraLaGuerra
#NoMásIntervenciones
#RespetoAlDerechoInternacional
#AntiImperialismo
#PeaceNotWar
#HandsOffVenezuela