Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в 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
❓Do you want to build a #dApp on Venom❓
✅ Join the VenomBlockchain dev community on Discord
➡️https://discord.gg/E5JdCbFFW7
🔎 Check Venom docs with development guides for smartcontracts, tokens, NFT, and more
➡️https://docs.venom.foundation/build/development-guides
⚡️TON Community: MyTonWallet v3.6 Features Unveiled
#TON#Dapp
The TON Community introduces MyTonWallet v3.6 with significant updates. Users can now track any wallet address and view $TON activity within the app, and share transfer links before confirmation. Discover new features like Remember Passcode and Dapp Action Previews.
Source: link
@tonlines
🆕We just released TokenPocket's new version on iOS. 🔺2.4.8🔺
🔵Support Boost Mode. 🚀#memecoin
🔵Native support for #DApp Content Translation.
🔵Native support for TRON Batch Transfer.
You can now upgrade your TokenPocket on the App Store. Ensure the developer is 'TP Global Ltd'.
🔗https://tokenpocket.pro
🆘 Просто эпический фейл от WalletConnect, который я обнаружил сегодня утром.
#WalletConnect - крупнейший (и возможно единственный) сервис подключения крипто кошельков к #dapp#web3 приложениям внес Украину и РФ в черный список.
По сути это парализует работу всего DeFi для СНГ. Вот такая децентрализация или иначе - отсутствие альтернатив “не из США”!
🍌
30 million users in Bitget Wallet!🌐
Bitget Wallet is a cutting-edge Web3 multi-chain wallet that offers a comprehensive platform with wallet, exchange, NFT marketplace, DApp browser, and Launchpad features. Supporting over 100 public blockchains, Bitget Wallet aggregates top DEXs and NFT markets to provide users with the best trading prices.
Bitget Wallet's mission is to create a world-class decentralized crypto wallet that provides a secure and convenient trading experience for all crypto enthusiasts.
Since its founding in May 2018, Bitget Global Inc. has been providing secure asset storage, fast trading, exchange, and investment in DeFi to over 30 million users worldwide. Now it is not just a wallet but an entire ecosystem that provides access to various activities and airdrops.
Tomarket Airdrop
Bitget On Chain Fund Invests in Tomarket App, Fast-Growing Web3 Game on TON. Airdrop scheduled for September.
Join the farming and get 2,000 🍅 $TOMATO tokens at the start!
Download Bitget Walletand start your Web3 journey now!🚀💎
#BitgetWallet#Web3#NFT#TON#DApp#DEX
🆕 0xMantle Bridge now fully supports TokenPocket login, and the official bridge is also listed on the TokenPocket #Mantle Hot #DApp List!
👉https://bridge.mantle.xyz/
🔥You can access Mantle Bridge with your TokenPocket wallet and enjoy the #MantleJourney!
👉https://extension.tokenpocket.pro/#/
👉https://www.tokenpocket.pro/en/download/app
#TokenPocket#MantleJourney
【Details】https://twitter.com/TokenPocket_TP/status/1711686131371413918
【Powered By】Crypto Box
🆕 Mantle Bridge now fully supports TokenPocket login, and the official bridge is also listed on the TokenPocket #Mantle Hot #DApp List!
🔥You can access Mantle Bridge with your TokenPocket wallet and enjoy the #MantleJourney!
👉https://extension.tokenpocket.pro/#/
👉https://www.tokenpocket.pro/en/download/app
#TokenPocket#MantleJourney
【Details】https://twitter.com/TokenPocket_TP/status/1711685010049368156
【Powered By】Crypto Box
😼Catizen Mini Game Center Open Beta now LIVE!🚀🎮
👌 Dive into a world of top-tier games that blend fun with innovative earning opportunities. Enjoy exclusive rewards like game airdrops and referral bonuses.
👌 Earn a 10% top-up rebate from all your referrals across all games, including Catizen!
Don’t miss out — start your adventure in the Catizen Mini Game Center today! 🌟
🔡
🔡
🔡 Open beta is live! Report bugs or game feedback to earn 300 Catizen FishCoins 🪙
😸Explore Catizen Mini Game Center
#catizen#gamee#play#p2e#web3#gamefi#dogs#telegram#dapp#notcon#hamsetr