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

Резултати

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

Пребарај: #salaries

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

@addisstandardeng · Post #21882 · 30.03.2026 г., 12:13

News: #Tigray denies reports of #federal salary budget release, calls claims “misleading” Tigray Communication Affairs Bureau has dismissed circulating reports that the federal government has released #budget allocations for the #salaries of public servants in Tigray, describing the claims as “baseless” and “intended to mislead the public.” In a statement issued on 29 March, the Bureau said no such funds have been received to date, citing information from the regional Bureau of Finance and Resource Mobilization. “The information being disseminated is completely false,” the statement said, warning that the reports are designed to create mistrust between the regional administration and civil servants. The Bureau’s statement comes amid continued uncertainty over the restoration of federal budgetary support to Tigray which was blocked since October 2025. Read more: https://addisstandard.com/?p=56184

Addis Standard

@addisstandardeng · Post #21830 · 25.03.2026 г., 12:52

News: Teachers, students in #Tigray protest federal #salary suspension, call for international pressure Senior officials of the Tigray Interim Administration, alongside educators and students, staged large-scale protests across several towns in Tigray, including the capital #Mekelle, on 24 March 2026, condemning the federal government’s decision to “suspend civil servant #salaries” and calling for international intervention, regional broadcaster, Tigrai Television televised. The demonstrations, which drew thousands of teachers and students, underscored a deepening humanitarian and education crisis in the regional. Regional authorities say the federal government has halted salary payments for teachers since October 2025, a move they argue violates constitutional provisions and international legal obligations. #Amanuel_Assefa, Vice President of the Tigrai Interim Administration, told protesters that the suspension of budgets and salaries is a deliberate effort Read more: https://addisstandard.com/?p=56054