TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #197 · 4 јан.

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #ecf

当前筛选 #ecf清除筛选
Addis Standard

@addisstandardeng · Post #21104 · 17.01.2026 г., 08:32

News: #IMF approves $261 million disbursement to #Ethiopia, cites stronger macroeconomic performance The International Monetary Fund (IMF) has approved the immediate release of US$261 million to Ethiopia under its Extended Credit Facility (#ECF), following the completion of the fourth review of the country’s reform program. The decision, the Fund said, reflects “stronger-than-anticipated macroeconomic outcomes and overall performance broadly in line with program commitments.” In a statement issued on 16 January 2026, the IMF said the Executive Board’s decision under the 48-month ECF arrangement will support Ethiopia’s balance of payments and fiscal financing needs. The disbursement brings total funding released under the program to approximately US$2.183 billion (SDR 1.6 billion). To strengthen the foreign exchange market, the IMF introduced a new performance criterion setting a zero limit on foreign exchange intervention outside of auctions. Read more: https://addisstandard.com/?p=54630

Addis Standard

@addisstandardeng · Post #21279 · 02.02.2026 г., 13:04

#Ethiopia: National Bank to phase out #gold premium, open purchases to private banks; #IMF warns exchange rate challenges hinder private investment The National Bank of Ethiopia (#NBE) is overhauling its gold transaction procedures to reduce risks to its balance sheet and curb distortions in the banking sector, according to the International Monetary Fund’s (IMF) latest review of Ethiopia’s Extended Credit Facility (#ECF) program. Under the new framework, the premium above international gold prices currently paid to miners will be phased out, while private banks will be allowed to participate in gold purchases. The NBE plans to develop a detailed implementation roadmap based on a study expected by the end of March 2026. In the meantime, quality control will be strengthened through expanded and improved gold testing at all purchasing sites. The central bank also intends to prepare a long-term exit plan from the gold market by the end of December 2026,... Read more: https://addisstandard.com/?p=54903