Вторая по частоте 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
#trailer
❇️Days Gone
🔹 Plot
A global pandemic occurred which decimated the globe, turning millions of humans into feral cannibalistic creatures, called Freakers. The remnants of humanity have abandoned towns to seek refuge in the wilderness creating safe zones.
❇️Aftermath
Deacon St. John, a member of the Mongrels MC, is among the survivors of the epidemic. Deacon drifts through the wasteland of the Pacific Northwest, never staying in one place for too long. Deacon often takes work as a Bounty Hunter/Mercenary, offering his services in exchange for supplies. However, Deacon learns that there is a price on his head adding to his list of enemies.
@fluencyinenglish
@ieltsstrategies
#trailer
❇️GLASS Trailer (2019)
@fluencyinenglish
Security guard David Dunn uses his supernatural abilities to track Kevin Wendell Crumb, a disturbed man who has 23 personalities.
@fluencyinenglish
In the trailer (via THR), Sarah Paulson (American Horror Story series) appears as a psychiatrist who describes herself as someone that specializes in “individuals who believe they are superheroes.” Present among her patients at a Philadelphia asylum are Bruce Willis’ David Dunn, Samuel L. Jackson’s Elijah Price, aka Mr. Glass, and James McAvoy’s Kevin Wendell Crumb, aka The Horde.
@fluencyinenglish
#trailer
❇️The passage
@fluencyinenglish
The plot:
🔹When a botched U.S. government experiment turns a group of death row inmates into highly infectious vampires, an orphan girl might be the only person able to stop the ensuing crisis.
@fluencyinenglish
#trailer
❇️How It Ends [HD] | Netflix
The plot: In the midst of an apocalypse, a man struggles to reach his pregnant wife, who is thousands of miles away.
@fluencyinenglish
@ieltsstrategies
Black Mirror Season 7 teaser just dropped
This globally popular Netflix series has drawn millions of viewers with its chilling, dystopian stories about the dark side of technology.
Past episodes like ‘Bandersnatch’ became worldwide hits, and this new season promises more twists and turns.
@Viral_Today / #trailer
🌐 Warner Bros. has released the first trailer for A Minecraft Movie, which hits theaters in April 2025 and stars Jack Black and Jason Momoa.
@Viral_Today / #trailer