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

Резултати

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

Пребарај: #ocro

当前筛选 #ocro清除筛选

🚀 OCRO IEO: Built to Rise, Designed to Reward IEOs are changing the game—and Octario Exchange is leading the way with OCRO. Unlike traditional ICOs, the OCRO IEO is hosted directly on the exchange, offering trust, transparency, and real structure. Powered by the Rising Edge Mechanism, OCRO’s price increases across 3 phases: from $0.30 to $0.80, before launching at $1.00. 📈 Each phase = limited supply + higher price 🎯 Early buyers = best value + built-in scarcity OCRO holders also get real utility: low gas fees, access to blockchain games, and real-world asset exposure. Don’t miss this rare chance to join a token economy engineered to grow. 👉 Participate now at 📢 Let’s talk about the Rising Edge Mechanism that makes OCRO unique: 📈 Upward-Only Pricing You can’t sell OCRO for less than your purchase price. Every sale must occur higher than the last. 🔓 Demand-Driven Supply Every buy unlocks more tokens from escrow, fueling circulation only when there is real demand. ⚡️ Momentum Over Volatility Instead of price drops, market activity creates upward pressure. The more people participate, the stronger OCRO becomes. 💠 This makes OCRO the first token designed to rise by design. 👉octario.exchange #OCRO#IEO#CryptoLaunch#OctarioExchange#BuiltToRise

INK GAME — OFFICIAL TEASER JUST DROPPED! Inspired by Squid Game. Dark. Intense. Only for the brave. 🎮🔥 The countdown has begun… 13 January 2026 — the arena opens. Only 456 players will step inside. Only the worthy will compete. 🔻 QUALIFICATION TO ENTER THE 456 🟥 20,000 USDT Direct Sales OR 🟥 10,000 USDT Self-Purchase (OCRO Phase 2) This isn’t just a launch event — it’s a selection. ⚡ Massive rewards. ⚡ One arena. ⚡ Choose your faction… and survive. #INKGame#Octario#OCRO#SquidGameStyle#456PlayersOnly

🚀 Top news! 🚀 We are launching the OCRO token with guaranteed growth - the price will rise from $0.02 to $0.10 in just 90 days from June 6th! 💥 And the best part: register with our exclusive link NOW and get a $50 gift as a thank you! 🎁 🔗 *https://octario.exchange/login/register?InvitationCode=833700* Join the future of crypto with guaranteed growth and cool bonuses! Don't miss your chance - join today! 🚀✨ #Crypto#TokenLaunch#OCRO#GuaranteedGrowth#Investments#CryptoCommunity#IEO