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

Резултати

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

Пребарај: #gandhi

当前筛选 #gandhi清除筛选
TALKS

@talks · Post #19 · 29.07.2016 г., 17:05

◼ I've been fascinated by life and extraordinary achievements of Great Mahatma Gandhi. This man has freed India from British oppression using non-violent protests, which is a miracle in my opinion. Unfortunately it's very hard to find a good quality footage of Gandhi's speech, however there's an amazing Oscar winning biographical movie made in 1982. And i found a really nice piece for YOU to enjoy. #Gandhihttps://youtu.be/e3tjIiWIkAQ

Hashtags

Addis Standard

@addisstandardeng · Post #21655 · 09.03.2026 г., 13:46

#IndiGo flight from Delhi to Manchester makes sudden mid-air U-turn near #Ethiopia A #Delhi–#Manchester flight operated by IndiGo made an unexpected mid-air U-turn near the Ethiopia border on Monday, with the reason for the diversion still unclear. Flight 6E33, operated on a Boeing 787-9 Dreamliner, had departed from Indira #Gandhi International Airport in 3New_Delhi on a scheduled service to Manchester in the #United_Kingdom. The aircraft was en route over East Africa when it abruptly changed course and returned toward Indian airspace. Flight tracking data shows that the plane had approached the Ethiopian border before performing the sudden turnaround. There has been no indication of. a technical fault or operational issue, and no official explanation has been provided by the airline. Passengers on board were reportedly unaware of any immediate danger, and the flight later ..... https://web.facebook.com/AddisstandardEng/posts/pfbid0DLWYcW6KDf5PwDbLUSGtFnaFaqFRT4wKEQFRdFoMFMQxHJc2HrXHWDYoZz4FVugvl