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

Пребарај: #henoa

当前筛选 #henoa清除筛选
Quiet World 🍁

@QuietWorld · Post #7416 · 17.06.2020 г., 04:12

I sprayed her butt just a little with hand sanitizer because she keeps on biting wires on the desk.. I swear just a little 🥺 & she slowly sit there, lying down, with her eyes looking at me for a while until slowly falls asleep 🥺 she stopped biting the wires but I feel bad 🥺 Is she sad? or just tired? 🥺 #random#Henoa @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7401 · 15.06.2020 г., 06:42

Today, a thought strucked me; I love looking at cats especially high breed cat but I never wanted to buy and take care of high breed cat because I'm scared that I'm not able to take good care of it since high breed requires high maintenance.. So, I only wanted to take care of village cat, but then, I treat the village cat like high breed cat 😂 So.. why was I scared to adopt/buy high breed cat, right? I treat my village cat like royal anyway 😂 * currently waiting for my kitten to come back from home-based grooming service (waiting anxiously) * I hope she comes back here safe 🥺😢 #thoughts#cat#Henoa @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7402 · 15.06.2020 г., 07:48

Yeyy she's finally back from grooming 😍 Her nails clipped, ears cleaned and she smells good ☺❤ I'll get no more scars because her habit of climbing me 🤣 for now.. until her nails grow long and sharp again 🤣 Worth the wait.. from 12:30PM until 03:40PM🥰 #cat#Henoa#chupdate @quietworld🍃

Quiet World 🍁

@QuietWorld · Post #7450 · 27.06.2020 г., 23:02

Shopping for Henoa le Kitten again! 😍 Unplanned but I found item that I didn't know exist before that I think Henoa & I needs and I read lots of reviews saying that this shop sells a lot cheaper than other stores so why not? 😂 Will be making a video of unboxing these + review once they arrived and tested 🥰💞 Stay tuned for this video upload in my channel 🥰 #marcegetaway#youtube#kitten#Henoa @quietworld🍃