Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в 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
Tilapia are well-suited for aquaculture due to their rapid reproduction, ability to consume a wide variety of food, tolerance for crowded conditions, and adaptability to different water types.
[Go fish]
@googlefactss#fish#farming
🗿 GemSquads: Farming
Stonfiers! We have added rewards to the top 10 farms based on the results of the GemSquads voting. Farming begins now!
👉 COFE/TON
🗿 Rewards: + 4,090 STON (~$24,300)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 PUNK/TON
🗿 Rewards: + 1, 594 STON (~$9,500)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: 30 days
👉 REBA/TON
🗿 Rewards: + 856 STON (~$5,000)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 REBA/USDT
🗿 Rewards: + 749 STON (~$4,500)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 ANON/TON
🗿 Rewards: + 666 STON (~$4,000)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 HYDRA/TON
🗿 Rewards: + 590 STON (~$3,500)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 LLAMA/TON
🗿 Rewards: + 454 STON (~$2,700)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 PET/TON
🗿 Rewards: + 400 STON (~$2,400)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 TON/CATS
🗿 Rewards: + 330 STON (~$2,000)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
👉 TON/DICK
🗿 Rewards: + 271 STON (~$1,600)
🗿 Farming period: until October 1
🗿 LP tokens lock-up in smart contract: no
🔗Start farming tokens🔗
❓How to earn rewards?
Stake LP tokens in the Pools tab. The higher your share in the farming pool, the larger share of rewards you'll receive. Rewards can be claimed at any time! ✨
❓How to vote for farms and increase rewards?
Stay tuned for announcements of the new GemSquads voting. During this event, Stonfiers send GEMSTON to the addresses of selected farms. Based on the distribution of votes, the rewards are allocated when farming starts.
#farming#tokens
DEX | Telegram DEX | Onboarding| Guide | Blog | All Links
🐦Twitter🎮Discord🤖Reddit💼LinkedIn
🗿 DYOR & SPNG Farming
⚡️ Stonfiers! Farming on STON.fi continues, and we’re creating new farms.
👉TON/DYOR
DYOR is the utility token of the analytical platform DYOR.io which allows users to track various metrics of tokens, NFTs, and applications on the TON Blockchain.
🗿 Rewards: $10,000 in DYOR tokens
🗿 Farming period: until November 25
🗿 LP tokens lock-up: 14 days
👉SPNG/TON
SPNG is the memecoin from the SPONGE community.
🗿 Rewards: 18,000,000 SPNG (~$2,000)
🗿 Farming period: until December 1
🗿 LP tokens lock-up: 30 days
🔗Farm tokens now🔗
❗️Reminder: LP-tokens are automatically issued upon providing liquidity. Our guide provides detailed instructions on farming on STON.fi.
Stay tuned!
#tokens#farming
DEX | Telegram DEX | Onboarding| Guide | Blog | All Links
🐦Twitter🎮Discord🤖Reddit💼LinkedIn
⚡️STON.fi: Exciting Updates on Farming Pools
#tokens#farming
The STON.fi channel has announced updates on their farming pools, with new farms being launched and existing ones extended. Highlights include SWITCH/TON v2 and BABYDOGE/TON v2 pools offering significant rewards. Participants can earn 10,000 STON or $10k in BABYDOGE by joining the farming activities.
Source: link
@tonlines
STON.fi: Exciting New Farming Pools Update
#tokens#farming
STON.fi announces new and extended farming pools, including a new BLINK/TON v2 farm with no LP token lock-up and a PUNK/TON v2 extension. BLINK is a token from Blink Game AI that rewards real-time blinking on a Telegram Mini App.
Source: link
@tonlines
⚡️STON.fi Update: New and Extended Farming Pools
#tokens#farming
STON.fi has announced updates for their farming pools, including the extension of PUNK/TON, JETTON/TON, and JETTON/USDT pools. A new MRDN/TON pool has also been introduced, with MRDN being the official token of the Meridian Club.
Source: link
@tonlines
⚡️Catizen Announcement: Massive Gift for COC Players
#COC#farming
Catizen Announcement unveiled a significant gift for Wipe Test players of COC. Players can now enjoy full-auto $COC farming, enhancing their gaming experience with 3 free ships and 1000 Diamonds for sailing mining.
Source: link
@tonlines
🔖Farming rewards migration onSton.fi
As you know, Ston.fi has started migrating to new V2 pools. In order to motivate liquidity providers to move their liquidity to the new pools, the DEX team has started migrating farming rewards.
If you farm in the following pools, we recommend transferring your liquidity to the new version pools:
TON/USDT V1👉TON/USDT V2
tsTON/USDT V1👉tsTON/USDT V2
stTON/USDT V1👉stTON/USDT V2
50% of the rewards (15,756 TON) have already been moved to V2 pools.
Next week, 100% of TON/USDT, tsTON/USDT, stTON/USDT rewards will be in V2 pools.
#farming#stonfi#DEX
🌍 The Netherlands grows so many greenhouse crops that it’s a top food exporter despite its small size. Advanced indoor farming allows year-round harvests even in cloudy northern Europe. ✨
#agriculture⚡#farming⚡#exports⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
*IMPACT FOUNDATION* is inviting you all to " *Meet A Legend* " 💪🙏
Date: *17th JANUARY,2021*
Time: *Sharp at 11AM* .
*_Legendary talk_* 🎯 with Brigadier(Retd) P.Ganesham.
*An Army officer Vision as "Palle srujana".*
To encourage rural innovations....and also let's know the beautiful journey of Chinna Shodha Yatra ......
#Army#Innovation#Farming🌱
https://us02web.zoom.us/j/84220843114?pwd=SDcraXJVd29WZXozTEFkYWJGbkI1Zz09
I'd: 842 2084 3114
PW: IMPACT
*YouTube live on www.youtube.com/Impactfoundation*
*Don't ever miss attending at sharp 11AM*
Hosting: *Sharvani Kasam*
Jai Hind Jai Bharat 🇮🇳
🗿DOGS farming on Ston.fi
Ston.fi launched 2 $DOGS farming pools:
😤DOGS/TON — 5000 STON
😌DOGS/USDt — 5000 STON
Farming period: until September 12.
There is no blocking of LP tokens in the smart contract.
✨You can alsovotefor DOGS pools in GemSquads Season 3 to increase farm rewards!
How to get rewards?
🗿Official Farming Guide on STON.fi
🔥 Don't miss your chance to get more tokens whose popularity has brought the entire network to a standstill.
#stonfi#DOGS#farming