Вторая по частоте future-функция, которую я использовал, это абсолютный импорт
from __future__ import absolute_import
Что она делает?
Изменения, которые вносит эта инъекция описаны в PEP328
Покажу простой пример.
Допустим, есть такой пакет:
/my_package
/__init__.py
/main.py
/string.py
Смотрим код в my_package/main.py
# main.py
import string
Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта:
1. модуль в моём пакете my_package.string
2. стандартный модуль string
И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string.
Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать.
from my_package import string
или относительный импорт, но с указанием пути относительно текущего модуля main
from . import string
Еще одной неоднозначностью меньше 😎
Подробней про импорты здесь:
https://docs.python.org/3/tutorial/modules.html
#2to3#pep#basic
Enhance your #CLMM experience on Cetus with smarter options🔥 Customize your liquidity range while also enjoying compatibility with the traditional full range
Whether you prefer a passive or active LP management approach, you can pursue APRs at varying levels, combining swap fee income and $CETUS rewards to maximize your returns
https://twitter.com/CetusProtocol/status/1680832630890156032?s=20
@everyone
Big news 🐳 Our "Concentrated Liquidity" pool is LIVE on the #Sui devnet! Designed for Sui's object-oriented structure, our #CLMM offers better capital efficiency, deeper markets & more programmability. Join our public test & help us make it stronger for future mainnet release!
https://twitter.com/cetusprotocol/status/1634204236769632257?s=46&t=ccsj9rNrt7PjDyElYNOfhQ
@everyone
New Pools: $ALT - $APT
Add liquidity to $ALT - $APT pool by @AptoslaunchIO on #Cetus and earn a significantly high APR from now🎉🎉
#Aptos#CLMM
https://twitter.com/cetusprotocol/status/1615351869861408769?s=46&t=6A2MjEjk9axhFYN50xgAVQ
@everyone
From alpha to beta, the biggest upgrade is to introduce the Concentrated Liquidity Market Maker (#CLMM), making #Cetus the first purely CLMM-based DEX with strong accessibility and security on #Aptos mainnet.
For more info, please check via
https://medium.com/@CetusProtocol/cetus-library-concentrated-liquidity-clmm-bd63936dfa0
https://twitter.com/CetusProtocol/status/1614263895002320896?s=20&t=03l0WjUh4HPq2H1rlAFKLA
@everyone
And now, with the latest beta version, here is the tutorial on how to add liquidity on Cetus which can also participate in our LP campaign.
Medium Article:
https://medium.com/@CetusProtocol/tutorial-how-to-add-liquidity-on-cetus-beta-clmm-fbfc529cfce3
#Aptos#CLMM#DeFi
https://twitter.com/CetusProtocol/status/1614159279191359488?s=20&t=pXosexBzqEiMmDee1Qw6FQ
@everyone
It's time🔥 Excited to launch our beta version, bringing you our brand new Concentrated Liquidity Pools.
From today, enjoy the next-level capital efficiency on #Aptos and swap with lower slippage ✈️Add your liquidity on #Cetus now to earn faster than ever!!
For more info, enter our dapp now!!
https://app.cetus.zone
#Cetus#CLMM#DeFi
https://twitter.com/CetusProtocol/status/1613877529169002496?s=20&t=OuwTEqbMPvEgyc7jzXVkgA
@everyone
Aptos Mainnet has arrived! To celebrate this, we are hosting a Giveaway of 300 XP and 5 OG roles to 5 winners🔥@everyone
👉RT+tag 3 friends+Comments👀
Cetus is building the most capital-efficient #DEX and #CLMM protocol in the #AptosEcosystem. We are proud to be part of it👍
https://twitter.com/CetusProtocol/status/1582361041790717953
@everyone
💥Brand new alpha version of #Cetus is NOW LIVE on #Sui Devnet!!
🫱Access our latest application via https://app.cetus.zone
#DeFi#AMM#CLMM
https://twitter.com/CetusProtocol/status/1592871290599542785?s=20&t=THmh2WKC7kM7X0PfXpqjEQ
@everyone