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

Резултати

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

Пребарај: #animals

当前筛选 #animals清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40547 · 16.01.2026 г., 23:01

The scientific name for "coyote" is canis latrans, which literally means "barking dog", a fitting description for its wide variety of yips, howls, and barks used for communication, with the name coming from the Aztec word for the animal. @googlefactss#animals

Hashtags

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40082 · 13.11.2025 г., 20:50

Female elephants stay with the same herd their entire lives. Males only remain with the herd until they are 12 to 15 years old. The Male elephants then either join a "bachelor" herd or they live alone only rejoining the females during mating season. @googlefactss#animals

Hashtags

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11860 · 09.03.2026 г., 15:02

#Animals Animals help each other too, and sometimes they do it more sincerely than humans. In nature, there are many amazing examples of cooperation: birds warn their flock about danger, dolphins support injured companions, elephants protect their calves, and some animals share food with those who are weak. This invisible bond of support and care is part of the harmony of nature. In the wild, survival often depends on cooperation and strong social connections. By observing animals, we learn a simple truth: the world is sustained not only by strength, but also by compassion, trust, and mutual help. 🐾🌿☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Hashtags

Daily Channels

@dailychannels · Post #6553 · 19.12.2025 г., 01:00

Channel: Dangerous Earth Members: ~5.44K 💢 Username: @dangerousground Description: Craters, volcanoes, avalanches, brutal animal scenes, deadly attacks by predators and many other strange displays of the forces of nature and its inhabitants. Buy ads: https://telega.io/c/dangerousground 🏷 Tags: #animals https://telegramchannels.me/channels/dangerousground

Hashtags

123•••5•••10•••15•••20•••25•••30•••35•••40•••45•••50•••55•••60•••6566
ПретходнаСтраница 1 од 66Следна