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 слични објави

Пребарај: #breakup

当前筛选 #breakup清除筛选
Pensive|

@PensivePost · Post #5785 · 30.05.2022 г., 07:59

She was totally surprised that I’d “let her go” after she admitted the cheating. She had expected a long intensive fight. But I did not want her back. In fact never, ever. She had turned into a liar — someone who had lied for months and months, each and every day. The irony is: the literal second before she told me the truth (which I had suspected for almost six months, but which she had virgorously denied), I would have done anything for her. I had fought for many months over a period which felt like one long nightmarish night with everything I got, but as soon as the truth — and nothing but the truth — was out, the fight was over. She was a liar. Had become one. Would always be one. So I did not fight anymore. That is to say: not for her. That had become a war I could not win anymore, and one she had already lost. So she was gone forever, and I realized I had to start all over again, trying to walk to new horizons and not knowing what to expect. After 10 fucking years. The nights became cold, and silent. And she smelled blood, smelled my weakness, so she went for the kill, for the money, for the house, thinking that now I was lying in my own pool of stinking tears, she might as well bash in my head and get it over with. She announced it to her friends, to her family. She would get the money. She would ruin me — she was a new person now, and would not care about her old life, ever again. (Her words.) And, dear friend, I will end my little sermon now with my own three beautiful words. She lost again. #review #breakup #auri