Функция 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
📰US stock prices soar in early Asian trading after truce news
🔗https://top-news.shepherdgazette.com/us-stock-prices-soar-early-asian-trading-truce/?utm_source=telegram&utm_medium=social&utm_campaign=zimm-distribute
via Daily Political Press
#Asian#TopNews#News
News: #Ethiopia, #Asian Infrastructure Investment Bank discusse support for Bishoftu airport project
Ethiopia’s Minister of Finance, Ahmed Shide, has held discussions with the President of the Asian Infrastructure Investment Bank (#AIIB) on potential financing support for the planned #Bishoftu International Airport project.
According to a statement from the Ministry of Finance, the meeting focused on strengthening cooperation between Ethiopia and the multilateral lender, with particular emphasis on priority infrastructure and development initiatives.
The two sides also explored avenues to expand collaboration in mobilizing private sector financing.
A week ago Addis Standard reported that Ahmed Shide, Ethiopia’s Minister of Finance, held high-level discussions with a delegation from the #China Export-Import (Exim) Bank and the Chinese Ambassador to Ethiopia, Chen Hai, the talks centered on exploring financing options for the construction of the Bishoftu....
Read more: https://addisstandard.com/?p=56203