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

Пребарај: #arvr

当前筛选 #arvr清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4143 · 13.02.2025 г., 19:00

Steve Yun Speaks at Consensus HK On February 20, Steve Yun from TON Foundation will present at Consensus HK, discussing 'Emerging Markets on the Road to Financial Freedom.' Join to explore DeFi's future and the impact of evolving regulations on Web3. Details here. ⚡️ OpenSea announces OS2 beta version and airdrop. Read more 🚓 In Thailand, Russians arrested for stealing Bitcoin worth $16.5 million. Read more 🧠 A look into the Metaverse and AR/VR projects you might have missed. Read more 🐋 VanEck says some US states will buy $23.5 billion in Bitcoin. Read more 👀 A new Bitcoin-ETF linked structured bond launches in Russia. Read more 🧐 JPMorgan identifies condition for Tether's compliance with US regulations. Read more ❌ Illegal Bitcoin farm shut down near Irkutsk. Read more 🤖 Sam Altman discusses features of GPT-4.5 and GPT-5. Read more 💫 BNB recovered losses following 2025 roadmap release. Read more 🔎 Ethereum Foundation allocates $120 million to DeFi protocols. Read more 👾 WLFI co-founder's X-account hacked to promote a scam. Read more 🔥 Former Greek finance minister criticizes Bitcoin maximalists. Read more #Finance#DeFi#Web3#Bitcoin#OpenSea#Crypto#Ethereum#EthereumFoundation#Cryptocurrency#Blockchain#Thailand#Regulation#CryptoNews#SamAltman#AI#Innovation#Technology#Investment#Metaverse#ARVR#VanEck