Вторая по частоте 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
This Giving Tuesday, stand with independent journalism!
As Washington intensifies efforts to undermine Venezuela’s Bolivarian Revolution, VA remains a vital voice exposing the truth, countering media propaganda, and uplifting grassroots socialist movements.
🎯 Support us today by donating at http://venezuelanalysis.com/donate to ensure our work continues!
#GivingTuesday#IndependentMedia#Venezuela
The corporate media has gone out of its way to endorse murderous sanctions against the Venezuelan people. Only outlets like Venezuelanalysis can fight back and set the record straight!
Help us out by backing our fundraiser!
Visit: www.venezuelanalysis.com/donate
#Fundraising#IndependentMedia#AntiImperialism#Venezuela
Venezuelanalysis is an independent outlet, free from corporate and political backers. Our mission to report on Venezuelan grassroots struggles is unwavering, but we need your support!
📍Make a one-time donation or subscribe to help us reach our goal here: https://venezuelanalysis.com/donate/
#Venezuelanalysis#IndependentJournalism#IndependentMedia#Fundraising
Oppose Trump’s War, Support Venezuelanalysis!
For over 20 years, we’ve stood with the Venezuelan people in their struggle for sovereignty. We’ve exposed US-backed aggression, documented grassroots resistance, and challenged dishonest media narratives.
Every contribution keeps this work alive. Click here to donate 👉https://venezuelanalysis.com/donate/
#Venezuelanalysis#Fundraising2025#IndependentMedia#Venezuela#SupportIndependentMedia
Fundraising 2025! 💪
We launch our yearly fundraising at a moment that feels more critical than ever. With Trump openly threatening to attack Venezuela and the corporate media beating the war drums, independent media must fight back.
For years, Venezuelanalysis has reported from the ground with accuracy and integrity; from documenting popular power to exposing dishonest narratives around sanctions. Today, our task is clear: counter war propaganda and defend peace and Venezuelan sovereignty.
Our work is 100% supported by readers and followers. That’s what keeps us independent. If you value this project, please consider making a donation or becoming a subscriber. Every contribution strengthens our ability to continue reporting in this historic moment.
Click here to donate 👉https://venezuelanalysis.com/donate/
#Venezuelanalysis#Fundraising2025#IndependentMedia#Venezuela#SupportIndependentMedia
Hong Kong weaponizes tax audits to suppress independent media
Hong Kong authorities are penalizing journalists and media outlets with unjustified tax demands, targeting independent press before audits are finalized.
🔹 Eight media outlets & 20 journalists hit with sudden tax audits.
🔹 Some taxed for nonexistent companies or for periods before their outlets existed.
🔹 HK$700,000 demanded from media, HK$1 million from individuals.
🔹 Critics warn tax laws are now tools for political repression.
#HongKong#PressFreedom#PoliticalRepression#IndependentMedia#TaxHarassment
香港利用稅務審查打壓獨立媒體
香港當局懲罰新聞機構和記者,以不合理稅款鎮壓獨立媒體。
🔹 8家媒體、20名記者* 突遭稅務審查。
🔹 部分遭要求支付不存在公司的稅款,甚至在 *媒體成立前已被審查 。
🔹 要求媒體繳納70萬港元,個別記者須支付100萬港元。
🔹 批評者警告:稅法已成政治打壓工具 。
#香港#新聞自由#政治打壓#獨立媒體#稅務迫害