Вторая по частоте 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
⚖️ Основатели проекта Dropil (DROP) Джереми Макалпин и Захари Матар согласились признать вину в мошенничестве с ICO на сумму почти $1,9 млн
Их обвинили в «серии ложных заявлений инвесторам» для «продвижения успеха криптовалюты». По данным Министерства юстиции США, основатели Dropil выплатили себе и партнерам как минимум $1,6 млн из привлеченных средств.
#ICO
Bought for $15.5k, sold for $122 million
#ETH holder purchased 50k$ETH at #ICO for $15.5k 9 years ago, and today he has 10 thousand coins ($24.37 million) on Kraken. In total, his coins are now valued at $122 million.
I waited for my chance🔥🔥🔥
💸Blockchain ICOs
This artist finally made me realize why all my money seem to vanish over time...
#Blockchain#ICO
🚀@PerspectiveIX via Reddit/u/nichlaes.
❓Have you invested in any ICOs?
An #Ethereum#ICO participant returned to sell 2,000 $ETH for 6M $USDC at $2,997 6 hours ago.
Notably, the whale received 33,213 $ETH at #Ethereum Genesis on Jul 30, 2015, at an ICO price of ~$0.31. So far, 5,110 $ETH has been deposited to #Kraken or sold via DEX at ~$2,545.
Currently, the whale still holds around 29.7K $ETH ($89.4M) across 3 wallets, mostly within staking platforms.
Follow @spotonchain and set alerts for the addresses of the ETH ICO participant via this entity now: https://platform.spotonchain.ai/en/entity/2098
An #Ethereum#ICO participant just woke up after 8.7 years of dormancy and transferred all 2,000 $ETH ($6.71M) to several new wallets!
The whale received 2,000 $ETH at #Ethereum Genesis on Jul 30, 2015, at the ETH ICO price of ~$0.31.
So far, 25 $ETH ($84.1K) has been deposited to #ChangeNOW at ~ $3,363.
Token flow: https://platform.spotonchain.com/en/visualizer?id=87887&thresholdOption=4
Follow @spotonchain and set alerts for the addresses of the $ETH ICO participant now!
An #Ethereum#ICO participant returned after 1.12 years to deposit 1,069 $ETH ($3.56M) to #Kraken at $3,329 3 hours ago.
The whale received 12,566 $ETH at #Ethereum Genesis in Jul 2015, at an ICO price of ~$0.31,
And then distributed the $ETH across 12 wallets in 2017, of which 4,847 $ETH have been deposited to #Kraken and #Gemini at ~$1,637.
Now still holds 7,719 $ETH ($25.7M) across 8 wallets.
Token flow: https://platform.spotonchain.ai/en/visualizer?id=99906
Follow @spotonchain and set alerts for the addresses of the $ETH ICO participant now!
🦄🦄Telegram is raising $1.7 billion in funding - and they're not even done!
#Telegram raised $850 million from 94 investors in March in addition to $850 million it gained in February. That's almost two whole unicorns in the largest #ICO (Initial Coin Offering) to date.
The company, founded by self-exiled Russian Pavel Durov, plans to use the ICO proceeds to develop the Telegram Open Network #blockchain, which includes the cryptocurrency #Gram.
Interest in the Telegram ICO has recently helped the company surpass the threshold of 200 million monthly active users, “with over 700,000 new users signing up each day.”
🚀@PerspectiveIX
🌀 http://prs.pctvix.co/TelegramIX
UK Regulator Takes Action Against Snap Over AI Chatbot
Hello, everyone! The UK Information Commissioner's Office (ICO) has issued a preliminary enforcement notice to Snap, the parent company of Snapchat. This notice could compel Snap to halt the processing of data associated with its AI chatbot, "My AI," for UK users unless an adequate risk assessment is carried out.
The ICO's provisional investigation revealed that the initial risk assessment conducted before the launch of My AI did not sufficiently evaluate its data protection risks, especially concerning children. As a result, Snap may be required to suspend its My AI product in the UK until these concerns are addressed.
#Snap#AI#DataProtection#ICO#UKRegulation