Вторая по частоте 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
Nod for Vizag Metro hinges on State's financial clearance.
Visakhapatnam district administration seeks ₹600 crore from the State government for private land acquisition under the ₹11,498 crore Metro Rail project
#Infrastructure#Infra
🇮🇷🇺🇸🇮🇱 L’infrastructure pétrolière et gazière iranienne sur les sites de South Pars et d’Assalouyeh a été frappée par les États-Unis et Israël, a rapporté l’agence Tasnim.
#infrastructure#frappe#iran
Fanton EN: Game Unavailability Due to Technical Issues
#infrastructure#Yandex
Fanton EN is currently facing a service disruption due to issues with their infrastructure provider, Yandex. The Yandex team is working to restore the system, and the game will be relaunched as soon as stability is confirmed.
Source: link
@tonlines
🇺🇸🚨BIDEN ANNOUNCES MAJOR INFRASTRUCTURE INVESTMENT
🔹 President unveils $2.1 trillion infrastructure package targeting roads, bridges, and broadband expansion across 50 states 🛣️💰
🔹 Plan includes 500,000 new jobs over next 4 years, focusing on union workers and American-made materials only 👷♂️🇺🇸
🔹 Republicans slam proposal as "reckless spending spree" while Democrats call it "essential for competitiveness" 💸🔥
🔹 Package requires Congressional approval — heated debates expected over tax increases to fund the massive investment 🏛️⚖️
This could reshape America's economy or bankrupt the nation. Which side is right? 🤔💭
#USNews#infrastructure#Biden
@america
👆Cruising down the highway of prosperity!
Experience a remarkable surge in capital expenditure on National Highways, paving the way for a journey towards high growth.
#NationalHighway
#NewIndia
#Infrastructure
Ukrainian Forces Strike Key Russian Oil Infrastructure
On the night of April 7, Ukrainian forces attacked the Ust-Luga Oil terminal in Leningrad region, destroying three Transneft-Baltika tanks. Earlier, on April 5, three RVSN-20000 tanks were damaged at the Primorsk port. Additionally, primary processing units at Lukoil’s refinery in Kstovo were hit. These strikes occurred via Baltic airspace following Moscow’s warnings.
#Russia#Oil#UAF#Infrastructure
The main news of Russia and the world ishere.
Кризис DRAM меняет рынок и подход к обучению современного ИИ.
✔️ Рынок захлестнул дефицит оперативной памяти и других накопителей: ИИ-гиганты выкупили огромные объёмы DRAM, HBM и NAND. Nvidia, по слухам, прекращает поставлять дистрибьюторам видеопамять в комплекте с GPU — теперь её нужно закупать отдельно. На текущий момент цены на SSD и оперативную память выросли на 50-100% по сравнению с началом года. Производители ноутбуков и смартфонов фиксируют задержки поставок, а комплект DDR5 на 64 ГБ уже стоит дороже PS5. 🤯
✔️ Мы спросили Гигачат, как кризис повлияет на развитие нейросетей и обучение моделей. ИИ-помощник формулирует так: "Дефицит памяти — это временный дисбаланс между взрывным ростом ИИ-индустрии и производственными мощностями, которые просто не успели масштабироваться под такой спрос. Высокая стоимость памяти заставляет компании переосмыслить подходы к обучению: вместо наращивания "железа напролом" фокус смещается на эффективные архитектуры и методы.". Подробнее — в видео.
@ai_machinelearning_big_data
#ai#llm#ml#ramcrisis#infrastructure
🌍 In the Alps, some villages rely on cable cars not just for tourists but for everyday transport. Steep slopes and deep valleys make cableways a crucial link for goods and people in remote mountain areas. ✨
#transport⚡#geography⚡#mountains⚡#infrastructure⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
UK Invests Big in AI Development
The UK has announced a substantial investment plan aimed at enhancing its AI capabilities. This initiative, part of a national renewal concept, will focus on developing neural networks for government efficiency, establishing AI growth zones, and bolstering essential infrastructure like data centers and research clusters. More details can be found in the article on ForkLog.
#AI#Investment#UK#Infrastructure#Tech