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

Резултати

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

Пребарај: #russiannature

当前筛选 #russiannature清除筛选
Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5582 · 20.10.2025 г., 12:00

The Northern Lights have reached the Moscow region! 🔻In a spectacularly rare event, the aurora borealis was visible even near Moscow last weekend. 🔻The heavenly glow was observed in the Arkhangelsk, Kostroma, and Moscow regions. The sky was also lit up with green and orange light in the Leningrad region. 🔻A stunning natural light show, much further south than usual! Videos, photos: the Internet #Russiannature 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4604 · 30.04.2025 г., 16:00

💙Dolphins near the coast of Balaklava, Crimea 🇷🇺В этом видео всё прекрасно: изумительная палитра моря, сливающегося с небом, тёмные силуэты скользящих в воде плавников, угрюмые скалы. Так хочется быть частью этого мира! А вам нравится? 🇬🇧Everything in this video is perfect: the amazing palette of the sea merging with the sky, the dark silhouettes of fins gliding through the water, the somber cliffs. I so want to be a part of this world! Do you like it? Video: kulikov_alex5 #Russiannature 😎RCRussian | Support | Boost

Russian Embassy in Asmara

@rusembasmara · Post #678 · 09.04.2026 г., 09:31

🇷🇺RUSSIAN NATURE🇷🇺 🏞️The Putorana Plateau is one of the most mysterious and picturesque places in Russia. Located in the northwestern part of Krasnoyarsk Krai, this region feels untouched by time: vast basalt plateaus, deep canyons and thousands of waterfalls define its landscape. 💧It is often called «the land of ten thousand lakes and waterfalls». In terms of waterfall density, the plateau has no equal in Russia. One of them, the Talnikovy Waterfall, is considered the highest in the country. 🏅The Putorana Nature Reserve is a UNESCO World Heritage Site that attracts researchers, photographers and seekers of unexplored wilderness. 🏔️Many people dream of visiting this region. For hundreds of kilometers, there are only mountainous areas, deep gorges and intricate networks of rivers, lakes and waterfalls. Helicopter tours and river rafting are especially popular, though some travelers also venture out on hiking expeditions. 🤗Visit Russia and set out on a journey! #RussianNature#Russia

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5468 · 22.09.2025 г., 19:35

🧡Somewhere in Russia... • На закате (НА + Prepositional) [na za-ka-te] At sunset, at dusk • Вечером (adverb) [ve-chi-ram] In the evening • На исходе дня (НА + Prep.+Gen.) [na is-khho-di dnya] At the end of the day ✨Всем добра! #Russiannature #useful_vocabulary 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #6249 · 01.03.2026 г., 16:00

Аптекарский огород Apothecary's Garden 🌷This is a garden where medicinal plants are grown. 🌷Historically, these were pharmacy gardens established by Peter the Great in the early 1700s to grow herbs for medicines. 🌷Today, it refers to Moscow's oldest botanical garden (founded 1706), now a branch of Moscow State University and a popular park where you can see beautiful flowers, exotic plants, and even a 300-year-old larch tree! Video: moscowmi #brief_and_interesting #Russiannature 🟠RCR | Support | Boost

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