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

Пребарај: #suggestions

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

@PensivePost · Post #5769 · 27.05.2022 г., 04:17

Chapter 1:The cuckoo's nest The irksome sound coming from someone's radio , "it must be morning " i muttered , tho i dont usually wake up this early on a holiday like this , so i tried to cover myself in the warmth of blanket but not enough to insulate that annoying noise and so i gave up on my dream. The sun was dim today quite unusual day for a summer . A strong pingent smell caught my glemse , after using my brain and nose i was able to find the cordinates of its origin. "Its coming from my balcony "i shouted , I jumped out of my blanket and opened the balcony , There was a dead cuckoo lying on the floor , might have fallen from its nest . I usually come to see this cuckoo been feed by a small Canary , that was a quite appealing view to watch or rather entertaining. The decaying body of cuckoo was alluring alot of bugs and ants, "Someone will live on someone's death" i said on a quavering voice , My neighbour was also in his balcony watching that cuckoo's , his balcony was just 1 feet away from mine . Unlike me his balcony was been decorated with lot of flowers , pot were hanging on the side of his wall. A green fluffy carpet all over his wall, giving more athestic look to his balcony , on the other hand my balcony have alot of poops of the birds which i never bothered to clean , a rusty chair which got its rust by weting in the rain , some clothes hanging here and there , being just 1 feet away and paying the same rent there was a lot of difference in our balconies , or rather alot of difference in our personality . He usually come to water his plants tho we never talked before. After spending few more minutes in balcony gloring the blueness of sky , I went back to my room , my stomach was starving by the time , I quickly went to check on my fridge for something to eat , even my bad luck is unlucky ,it just contains some rotten yogurts , broken beer bottles , a pouch of sous which is expired , a frozen fish . I went to my kitchen and found that i was out of instant noodles too. #review #novel #suggestions

GitHub Trends

@githubtrending · Post #15383 · 02.01.2026 г., 11:30

#go#customer#feature_request#feedback#ideas#suggestions Fider is a simple tool for collecting customer feedback, feature requests, and votes to prioritize what users want most. Use Fider Cloud for quick managed setup or self-host it free on your servers. Customize it, invite users to suggest ideas, vote, and discuss, then update statuses like "planned" or "done" to keep them informed. This saves time guessing needs, boosts customer loyalty through engagement, and helps build better products efficiently. https://github.com/getfider/fider