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

Резултати

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

Пребарај: #iranusrelations

当前筛选 #iranusrelations清除筛选
Crypto M - Crypto News

@CryptoM · Post #65212 · 12.04.2026 г., 02:25

🚀 U.S. Delegation Leaves Pakistan Without Agreement in Iran Talks On April 12, a U.S. delegation departed Pakistan after negotiations with Iran failed to reach an agreement. According to BlockBeats, the discussions did not yield any conclusive results. The talks were part of ongoing efforts to address issues between the two nations. The departure marks another chapter in the complex diplomatic relations involving the United States and Iran. #US#Pakistan#Iran#Diplomacy#InternationalRelations#Negotiations#DiplomaticTalks#IranUSRelations

Crypto M - Crypto News

@CryptoM · Post #65219 · 12.04.2026 г., 04:08

🚀 Polymarket Odds Drop as Iran-Israel/US Conflict Talks Stall Polymarket odds for the Iran-Israel/US conflict ending before April 15 have decreased to 47%, marking a 22% drop within 24 hours. According to NS3.AI, the odds for the conflict concluding before April 30 have also fallen to 55%, down 16%. This decline follows the latest round of US-Iran talks, which ended without reaching an agreement. #Polymarket#IranIsraelConflict#USTalks#IranUSRelations#OddsDrop#ConflictResolution#April15#April30

Crypto M - Crypto News

@CryptoM · Post #65243 · 12.04.2026 г., 08:27

🚀 Iran's Nuclear Concessions Could Be Key to U.S. Strategy, Citic Securities Says Citic Securities stated on April 12 that if Iran were to abandon uranium enrichment, it would represent a significant achievement for the U.S., particularly for U.S. President Donald Trump, who could use it to appease domestic concerns. According to Jin10, the ongoing conflict has already negatively impacted the midterm elections, necessitating a swift resolution. Since the Iranian Islamic Revolution, the U.S. has lost control over Iran's nuclear capabilities, a challenge that has persisted through multiple U.S. presidencies, affecting America's Middle East strategy. The political impact of Iran's potential nuclear disarmament is seen as more significant than the indirect effects of oil prices and inflation on elections. Consequently, the Trump administration might consider compromises on issues like control over the Strait of Hormuz. From Iran's perspective, the conflict has demonstrated that blocking the strait and threatening Middle Eastern infrastructure are powerful leverage tools, potentially more impactful than nuclear threats. These actions, which can be executed with low-cost drones, pose significant risks to the U.S. and global economies, providing Iran with a strategic counterbalance. Repeated near-escalations to large-scale infrastructure damage suggest that the likelihood of extreme war escalation is low, reducing the chances of extreme oil prices, severe recession, or stagflation. #Iran#NuclearConcessions#USStrategy#CiticSecurities#DonaldTrump#UraniumEnrichment#MiddleEastStrategy#IranUSRelations#StraitOfHormuz#OilPrices#Inflation#PoliticalImpact#TrumpAdministration#IranianLeverage#GlobalEconomy#InfrastructureDamage#WarEscalation#OilPrices#Stagflation