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

Резултати

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

Пребарај: #terny

当前筛选 #terny清除筛选
DruschbaFM - English

@druschbaFm_en · Post #52058 · 14.03.2025 г., 08:04

⚡️🇷🇺🇺🇦⚡️ Two Majors #Summary for the Morning of 14 March 2025; 07:00 (GMT+3)⚡️ 🛡 The Enemy attacked an oil complex in #Tuapse using drones overnight. One of the fuel storage tanks caught fire, with the blaze covering an area of over 1,000 square metres. Emergency services are on-site. Additionally, drones were shot down over the #Saratov and #Voronezh regions. 🔹 In #Kursk Region, the 'Group of Troops North' liberated #Zaoleshenka and the settlement of #Goncharovka, clearing the outskirts of #Sudzha from all sides. The enemy continues to strike the liberated areas, trying to inflict maximum damage on our forces. Footage of destroyed enemy equipment is emerging, showing that the AFU suffered heavy losses while attempting to withdraw from the region.🎬👆Fighting continues in the Kuriklovka area. More evidence is surfacing from the liberated territories, documenting atrocities committed by nationalists against civilians. Battles are also ongoing near Basovka in the Sumy region. 🔹 In #Liman Section, north of #Terny, reports indicate fighting in the area of #Novolyubovka. 🔹 In #Seversk Sector, the enemy reported Russian activity near 'Sakkо and Vanzetti', a section of the front that has not been mentioned in recent reports. 🔹 In #Toretsk, battles with enemy units continue in different parts of the city. The enemy is still deploying groups into the urban area. 🔹 In #Pokrovsk Direction, fighting continues near #Uspenovka, #Udachnoye, #Kotlino, #Peschanoye, and #Shevchenko. Despite the high intensity of combat, the front line remains largely unchanged. 💥 In #Belgorod Region, in the Volokonovsky district, a private residence in the village of #Konovalovo was damaged by a drone attack. In the hamlet of #Gayevka, a drone strike damaged a piece of specialised machinery. In the Valuysky district, an FPV drone attacked a cargo vehicle in #Kaznacheyevka, while another drone struck a private house. In the village of #Grafovka, Krasnoyaruzhsky district, two drones detonated. In the settlement of #Oktyabrsky, Belgorod district, an FPV drone strike injured two men. Another drone detonated in the settlement of #Dalny, Valuysky district, injuring a woman. In #Shebekino, two FPV drones struck an industrial facility. In the Volokonovsky district, in the village of #Borisovka, a Nazi drone attacked a private residence. 💬Welcome to Military Chat; 🇬🇧Battle Maps 📱 Join GLOBAL DEPTH to boost your TG Feed GLOBAL DEPTH from #HK This channel aims to unite interested individuals from around the world in an attempt to connect the dots. Subscriber participation is always welcome here and in the channel's Chat Group.