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

Резултати

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

Пребарај: #ecosystems

当前筛选 #ecosystems清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #643 · 28.08.2025 г., 03:22

🌎 Entering the massive Krubera Cave in Georgia is like descending into another world—at over 2,197 meters deep, it’s the deepest known cave on Earth. These underground labyrinths feature rivers, waterfalls, and unique blind creatures, revealing entire ecosystems hidden from sunlight. ✨ #geology⚡#caves⚡#ecosystems 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #630 · 26.08.2025 г., 00:22

🌎 From blazing deserts to frozen poles, Earth's extreme climate zones push life to its limits. In polar regions, temperatures plunge below -50°C, creating icy landscapes where only the hardiest animals, like penguins and polar bears, survive. Meanwhile, equatorial deserts like the Sahara reach scorching highs over 50°C, supporting unique plants and animals adapted to relentless heat. These climate extremes shape our planet’s most remarkable ecosystems and inspire some of nature’s wildest survival strategies. ✨ #climate⚡#ecosystems⚡#adaptation 👉subscribe Interesting Planet ​

Amazing Geography 🌍

@amazingeo · Post #542 · 28.12.2025 г., 20:31

🌍 The Serengeti savanna in Africa hosts one of the world’s largest mammal migrations—zebras cross first, followed by wildebeest, each group timing their journey to feed on different heights of grass. ✨ #savanna⚡#migration⚡#ecosystems⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Amazing Geography 🌍

@amazingeo · Post #583 · 20.01.2026 г., 20:31

🌍 Africa’s Miombo savanna covers over 2.7 million square kilometers—about the size of Argentina. Its woodlands support hundreds of unique butterfly species found nowhere else on Earth. ✨ #savanna⚡#grasslands⚡#ecosystems⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #927 · 17.10.2025 г., 22:11

🌎 Hidden off the Pacific coast of California, the Point Dume Submarine Canyon plunges over 800 meters deep just a short distance from shore. Scientists have discovered mysterious methane seeps and rare deep-sea corals within the canyon. These underwater features support unique ecosystems not found anywhere else nearby. ✨ #ocean⚡#canyon⚡#ecosystems 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #589 · 19.08.2025 г., 16:22

🌎 Some bamboo species can grow up to 91 centimeters in a single day, making bamboo one of the fastest-growing plants on Earth. This rapid growth helps bamboo quickly regenerate after being harvested and provides vital habitats for many animals. ✨ #botany⚡#speed⚡#ecosystems 👉subscribe Interesting Planet

Interesting Planet 🌍

@interesting_planet_facts · Post #484 · 02.08.2025 г., 03:22

🌎 Deep in the Congo Basin, the African rainforest elephant forges secret trails through dense jungle, creating “elephant highways” that other animals use. These hidden paths help shape entire forest ecosystems by opening routes for seed dispersal and wildlife movement. ✨ #rainforest⚡#elephants⚡#ecosystems 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #647 · 25.02.2026 г., 20:31

🌍 Submarine hydrothermal vents on the ocean floor release superheated water and minerals, fueling unique ecosystems powered by chemical energy instead of sunlight. ✨ #processes⚡#ocean⚡#ecosystems⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #466 · 30.07.2025 г., 13:22

🌎 In the dry canyons of the American Southwest, cryptobiotic soil forms a living crust of bacteria, fungi, and lichens. This fragile layer stabilizes desert soil and helps seeds germinate, supporting entire ecosystems in these harsh climates. ✨ #desert⚡#microbiology⚡#ecosystems 👉subscribe Interesting Planet

Amazing Geography 🌍

@amazingeo · Post #280 · 21.09.2025 г., 22:31

🌍 Some deep-water corals build reefs in cold, dark oceans thousands of meters below the surface. Unlike tropical reefs, these cold-water reefs thrive without sunlight or warm water. ✨ #coral⚡#marine⚡#ecosystems⚡#ocean⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Amazing Geography 🌍

@amazingeo · Post #223 · 12.09.2025 г., 13:12

🌍 The highest forests on Earth grow above 4,900 meters in the Andes, where trees survive thin air, cold temperatures, and strong sunlight—an extreme zone where biosphere meets atmosphere and lithosphere. ✨ #spheres⚡#Andes⚡#ecosystems⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍 ​

Interesting Planet 🌍

@interesting_planet_facts · Post #619 · 24.08.2025 г., 03:22

🌎 The tuco-tuco, a South American rodent, lives almost its entire life underground. It digs vast tunnel networks with specialized teeth, rarely surfacing except to gather food. Its burrowing helps aerate soil, making tuco-tucos quiet but essential ecosystem engineers. ✨ #rodents⚡#ecosystems⚡#burrowing 👉subscribe Interesting Planet ​

12
ПретходнаСтраница 1 од 2Следна