Вторая по частоте 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
Trump Chalked the Obama-as-Apes Case Up To Personal Animosity
Trump said on Friday he made the call to post a now-deleted video depicting Barack and Michelle Obama as apes but deflected blame for the move, causing new speculation in his orbit about whether the blame lay with the president or his aide Natalie Harp.
The brief clip, shared late Thursday night on Trump’s Truth Social account, appeared in a video pushing conspiracies about the 2020 election.
Invoking racist tropes, the video depicted the Obamas’ faces superimposed on the bodies of cartoon apes dancing to The Lion Sleeps Tonight.
“No, I looked at the first part. It was really about voter fraud and the machines – how crooked it is (...) it might look personal,” Trump said.
“Then I gave it to the people, generally they’d look at the whole thing but I guess somebody didn’t and they posted it. And then we deleted it.”
Trump’s recounting sparked speculation inside his orbit about the extent to which the president was responsible and which of his aides ultimately hit “send” on the post.
Besides Trump, only two aides have access to his social media account, people familiar with the matter said: Dan Scavino and Harp.
Trump’s advisers quickly discounted Scavino, given he has been preoccupied lately with his new role running the presidential personnel office – and instead focused on Harp, who has previously been entangled in Trump’s communications.
The White House did not respond to a request for comment about the intrigue at the end of a tumultuous day, which began with the press shop defending the post before it backtracked and blamed a staffer – a claim Trump also repeated in calls with Republican lawmakers.
In a call with Tim Scott, the only black Republican senator, who is also the chair of the national Republican senatorial committee and explicitly denounced the video as racist, Trump said it was a staffer’s mistake and that he would take the video down, CBS News reported.
Over time, Harp established a broader role as a conduit of information to and from the president, relaying to him text messages, social media posts and news articles she believed he would appreciate.
But she has also been criticized by colleagues for showing poor judgment – for instance, when she sent an aggressive text to the Trump megadonor Miriam Adelson in the summer of 2024 criticizing her $100m Super PAC as being poorly managed, a person familiar with the matter said.
The White House did not respond to a request for comment about the intrigue at the end of a tumultuous day, which began with the press shop defending the post before it backtracked and blamed a staffer – a claim Trump also repeated in calls with Republican lawmakers.
In a call with Tim Scott, the only black Republican senator, who is also the chair of the national Republican senatorial committee and explicitly denounced the video as racist, Trump said it was a staffer’s mistake and that he would take the video down, CBS News reported.
#trump#whitehouse#harp#obama
📱American Оbserver - Stay up to date on all important events
🇺🇸
Went to the museum on the weekend and came across a huge harp. 😮✨
So beautiful I just couldn't walk past. Immediately wanted to stand next to it and take a photo — like I stepped into another era.
#LunaEverly#Museum#Harp#AmazingInstruments#Beauty
Various Artists — The Crying Princess (Sublime Frequencies, 2024)
#traditional#pwe#saung#harp#Myanmar
The Crying Princess — сборник редкой бирманской музыки, выпущенный лейблом Sublime Frequencies под кураторством известного художника, режиссёра и коллекционера Роберта Миллиса. Альбом включает записи с патефонных пластинок (78 оборотов в минуту), сделанные в период с 1909 по 1960 год. Эти треки были собраны Миллисом и сооснователем Sublime Frequencies Аланом Бишопом во время их поездок в Бирму (ныне Мьянма).
Примечательно, что к концу 60-х выпуск патефонных пластинок по всему миру практически полностью сошёл на нет, что делает эти записи особенно ценным историческим документом.
В сборник вошли выступления По Сейна (ဘိုးစိန်), влиятельного певца и актёра бирманского театра «Пве», а также ранние записи традиционных вокальных стилей, музыки для арфы саунг и даже поп-песни с электрогитарой.
Роберт Миллис внёс значительный вклад в сохранение и популяризацию ранних записей музыки Юго-Восточной Азии. Его книги, фильмы и сборники посвящены исследованию редких музыкальных традиций. Среди них —Indian Talking Machine и Victrola Favorites. The Crying Princess — очередной шаг на пути к выполнению его миссии.
🔗Bandcamp
Malvasia — Malvasia (Cetra, 1979)
#traditional#baroque#celtic#organetto#accordion#mandolin#harp#bagpipes#France#Italy
Единственная пластинка итальянской группы Malvasia, названной в честь семейства сортов винограда, распространённого в средиземноморском регионе, из которого делают самую сладкую Мадеру, греческий ликер и множество различных вин. Группа исполняла различные традиционные композиции, включая итальянские, французские и даже кельтские. Не удивительно, что их звучание испытало влияние кельтской музыки, музыки эпохи барокко и средних веков. Все композиции с альбома записаны с использованием традиционных акустических инструментов, среди которых волынка, мандолина, различные флейты, арфа, скрипка и аккордеон.
Telegram