TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте 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

Резултати

Пронајдени 7 слични објави

Пребарај: #assab

当前筛选 #assab清除筛选
Addis Standard

@addisstandardeng · Post #21555 · 28.02.2026 г., 06:49

#Abiy’s vision of #Ethiopia includes a seaport in #Eritrea. Some see a looming conflict To his supporters, Ethiopia’s prime minister is a renaissance man trying to reimagine the old greatness of his country. To some others, Abiy Ahmed is a provocateur who could light a fire in the restive Horn of Africa region as he pushes for sovereign access to the sea via an unfriendly neighbor. In a stadium in southern Ethiopia last Sunday, Abiy staged a provocative parade of Ethiopia’s special forces as they demonstrated maneuvers in a spectacle widely seen as intended for neighboring Eritrea to see. A banner proclaimed Ethiopia would not remain landlocked whether “you like it or not,” with imagery showing a soldier breaking a door while aiming for the port of #Assab. Assab has been part of Eritrea since 1993, when it broke away from Ethiopia after decades of guerrilla warfare. Most of Ethiopia’s trade goes through... https://apnews.com/article/ethiopia-prime-minister-abiy-eritrea-01542a9d7954e0d2f94a7dbe7b00340e

Addis Standard

@addisstandardeng · Post #21719 · 14.03.2026 г., 11:49

News: Renewed #Ethiopia–#Eritrea war could ignite conflict spanning 10–15 countries on three continents, trigger “Africa’s Second World War,” expert warns A renewed war between Ethiopia and Eritrea could ignite a broader conflict involving 10–15 countries across three continents and risk becoming “#Africa’s Second World War,” a conflict expert has warned, according to a report by Anadolu Agency. Speaking to Anadolu Agency, Kjetil Tronvoll, professor of peace and conflict studies at #Oslo New University College, said tensions between the two neighboring countries have sharply escalated and could draw in regional and international actors if fighting erupts. The expert suggested that regional and international actors could still help prevent escalation by increasing diplomatic engagement, pressing Eritrea to end interference in Ethiopia’s internal affairs, encouraging negotiations over Ethiopia’s potential use of the port of #Assab....... Read more: https://addisstandard.com/?p=55840

Addis Standard

@addisstandardeng · Post #21930 · 03.04.2026 г., 09:39

News: AI-generated war narratives fuel #Ethiopia–Eritrea tensions online: report Artificial intelligence (#AI) generated images and videos portraying a hypothetical #Ethiopian military takeover of #Eritrea’s strategic port of #Assab are increasingly shaping online narratives and inflaming tensions between the two countries, according to a report by #AFP. One of the most prominent creators, 24-year-old Ethiopian law graduate Eliyas Kebede Zemedkun, who has more than 87,000 Facebook followers, told AFP he has spent much of 2026 producing AI-generated content depicting Ethiopia occupying Assab to promote what he described as “Ethiopia’s national narrative.” “I am also motivated to use AI-generated content to challenge narratives that try to downgrade the national army through different demoralizing tactics,” he said, adding that he uses free platforms such as #ChatGPT and #Gemini alongside editing software to create the material. Read more: https://addisstandard.com/?p=56283