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

Резултати

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

Пребарај: #disaster

当前筛选 #disaster清除筛选
Amazing Geography 🌍

@amazingeo · Post #28 · 10.08.2025 г., 14:31

🌍 In 1815, Indonesia’s Mount Tambora erupted so violently that it triggered “the year without a summer.” Global temperatures dropped, causing crop failures and food shortages across continents. ✨ #disaster⚡#volcano⚡#climate⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍

Amazing Geography 🌍

@amazingeo · Post #320 · 01.10.2025 г., 18:31

🌍 In 2015, Chile’s Calbuco volcano erupted after 43 years of silence, blasting ash over 15 kilometers high. Its sudden activity disrupted air travel and blanketed towns in thick volcanic dust. ✨ #volcano⚡#disaster⚡#eruption⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #166 · 03.09.2025 г., 03:12

🌍 In 2023, Cyclone Freddy became the longest-lasting tropical cyclone ever recorded, traveling over 12,000 kilometers and affecting countries from Madagascar to Mozambique with powerful winds and rain. ✨ #cyclone⚡#disaster⚡#weather⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #473 · 24.11.2025 г., 12:31

🌍 In 2023, Cyclone Mocha became one of the strongest storms ever recorded in the North Indian Ocean, with winds over 250 km/h, causing severe flooding and reshaping coastal landscapes. ✨ #disaster⚡#cyclone⚡#flooding⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #581 · 19.01.2026 г., 20:31

🌍 In 2023, Cyclone Biparjoy spun over the Arabian Sea for nearly two weeks—a rare “very severe cyclonic storm” to last so long in this region, with winds impacting coasts over 1,000 kilometers apart. ✨ #cyclone⚡#disaster⚡#winds⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #359 · 11.10.2025 г., 15:31

🌍 The 1811–1812 New Madrid earthquakes in the central United States were so powerful they briefly made the Mississippi River flow backward, reshaping the landscape far from any plate boundary. ✨ #disaster⚡#earthquake⚡#river⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40976 · 25.04.2026 г., 22:01

On 26 April 1986, the Chernobyl disaster occurred at the Chernobyl Nuclear Power Plant in the Soviet Union (now Ukraine). During a safety test on Reactor 4, operators lost control of the reactor. This caused a powerful explosion and fire that destroyed the reactor and released large amounts of radioactive material into the atmosphere. It is considered the worst nuclear accident in history. The nearby city of Pripyat was evacuated after the explosion. The area is mostly uninhabited, but a small number of people still live or work there. ☢️🏭🌍 [Read more 1] [Read more 2] @googlefactss #Chernobyl#NuclearAccident#History#Ukraine#Disaster If you have ideas or feedback contact us: @Googlefactss_Feedback_bot