Вторая по частоте 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
🔤🔤🔤🔤🔤
StepMania is officially live! 🥂
More steps – more coins, guys!
StepMania is not just a pedometer but a move-to-earn app where every step is rewarded, new records keep you motivated, and the community fuels the excitement.
How does StepMania work?
🌎Pedometer – track your activity and set personal records!
🥇Leaderboards – compete with friends and other users to reach the top!
💬Community – share your achievements, exchange tips, and stay motivated!
🏳️Plus, awesome giveaways! Gadgets, subscriptions, and other bonuses for active users right from the start!
Stop tapping! With StepMania, walking is not just healthy but also rewarding. Step up and earn.
Walk to Earn
Join the game👉link
#Stepn#Stepmania#Earn
Crypto Currents | Get referrals | Buy Telegram Stars
❤️Vanilla Finance Closes Pre-Seed Investment Round ✔️
Singapore, November 26, 2024 – Vanilla Finance, the leading exchange by trading volume on #Telegram, has announced the successful closure of its Pre-Seed investment round. Spearheaded by industry giants like Paper Ventures, UOB Ventures, and ABCDE Labs, the round also attracted notable participants such as #HTX Ventures, #Ocular, #Openspace, #Y2 Ventures, and angel investors from #STEPN, #Scroll, #XAI, and more.
🔫A Game-Changer in the Digital Asset Space
Since its launch, #VanillaFinance has made waves, amassing over $8 billion in USDT trading volume within just 60 days. This meteoric rise is further validated by winning the prestigious #Binance MVB Season 8, a recognition of the platform’s cutting-edge solutions and market leadership.
👏Visionary Growth and User-Centric Innovation
With fresh funding and institutional backing, Vanilla Finance is on a mission to redefine crypto trading by:
• Simplifying User Experience: Introducing intuitive, secure features tailored for both novices and experts.
• Expanding Offerings: Launching a spot market, with a focus on meme trading pairs, and rolling out features like a meme creator platform, staking products, and futures trading.
• Regional Focus: Targeting Southeast Asia and APAC with localized services, multilingual support, and integration with regional payment systems.
💰Institutional Confidence in a Bright Future
The involvement of strategic investors highlights Vanilla Finance’s potential. A UOB Ventures spokesperson praised the platform’s innovative approach, while Danish Chaudhry of Paper Ventures noted, “Vanilla Finance’s expansion aligns perfectly with the Southeast Asia and APAC markets’ untapped opportunities in digital finance.”
📖Building a Next-Generation Ecosystem
Beyond trading, Vanilla Finance is creating an ecosystem that prioritizes community engagement and innovation. With its unique approach to meme trading and user-focused features, the platform is poised to set a new benchmark in digital asset trading.
✈️The Future Starts Here: Vanilla Finance is committed to serving the next 100 million users, shaping a more inclusive, engaging, and forward-thinking crypto landscape.
❤️ Join Vanilla mini-app now and get as much $CONE as you can before the airdrop!