Вторая по частоте 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
🏴Intensa jornada en el mercado de fichajes de la Premier League:
🇧🇪Sebastian Bornauw (26 años) ficha por el Leeds. El acuerdo con el Wolfsburg y los 'whites' se cierra por cerca de €6M.
🏴El delantero escocés Dan Cummings (19 años) es nuevo refuerzo del West Ham. Llega libre tras terminar contrato con el Celtic.
🇸🇳Habib Diarra (21 años) ficha por el Sunderland. Han pagado casi €32M por el mediocampista al Estrasburgo, lo que lo convierte en el fichaje más caro de la historia de los 'black cats'.
🇳🇱El delantero Zepiqueno Redmond (19 años) llega al Aston Villa como agente libre tras quedar desvinculado del Feyenoord.
@LaGuiadelFutbol | #PremierLeague
⚡️Fanton EN: Premier League Gameweek 35 Overview
#PremierLeague#fantasy
Fanton EN presents a preview of Premier League Gameweek 35, covering key matches like Leicester vs. Southampton, Chelsea vs. Liverpool, Brighton vs. Newcastle, and Crystal Palace vs. Nottingham Forest. Each game carries significant implications for fantasy lineups, with Liverpool, Newcastle, and Nottingham still battling for crucial spots.
Source: link
@tonlines
Manchester City es campeón por 4ta vez consecutiva en la Premier League, luego de vencer 3-1 al West Ham
@Fut_planet⚜️#PremierLeague🏴#City🏴
Title races are rarely decided by headlines alone.
Probability shifts long before the table confirms it.
#ManchesterCity#PremierLeague#EdgeMarket#PredictionMarkets
Después de una temporada dónde veíamos al Chelsea de mal en peor logró lo que se veía imposible
Venció 2-1 al Bournemouth, y con un golazo de Moisés Caicedo el conjunto londinense se clasificó a la próxima edición de la UEFA Europa League🟠
@Fut_planet⚜️#PremierLeague🏴#Chelsea🏴#UEL🟠
England Premier League🏴
2026-05-13 19:00 UTC
Manchester City vs. Crystal Palace
Predicted outcome: Manchester City✅
Predicted score: 3:1
Actual: Manchester City 3:0
#ManchesterCity#CrystalPalace
#Football#PremierLeague
England Premier League🏴
2026-04-20 19:00 UTC
Crystal Palace vs. West Ham
Predicted outcome: Draw✅
Predicted score: 1:1
Actual: Draw 0:0
#CrystalPalace#WestHam
#Football#PremierLeague
England Premier League🏴
2026-05-11 19:00 UTC
Tottenham vs. Leeds
Predicted outcome: Leeds❌
Predicted score: 1:2
Actual: Draw 1:1
#Tottenham#Leeds
#Football#PremierLeague
England Premier League🏴
2026-05-01 19:00 UTC
Leeds vs. Burnley
Predicted outcome: Leeds✅
Predicted score: 2:1
Actual: Leeds 3:1
#Leeds#Burnley
#Football#PremierLeague