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

Резултати

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

Пребарај: #onton

当前筛选 #onton清除筛选
TONlines – News

@tonlines · Post #6777 · 15.04.2025 г., 13:11

bemo: ONTON and ONION Roadmap Launch #ONTON#NFT The bemo channel announces the launch of the Genesis ONIONs x ONTON roadmap, marking an important milestone for the platform. With over 100 partners and more than 3,000 NFTs already reserved, the roadmap outlines the future developments for the ONTON platform and promises significant value for Genesis NFT holders. Source: link @tonlines

Hashtags

🏅Distribution of unique SBT badges to ONTON & GVWS Marathon participants has begun! 🤝 The ONTON team, together with GVWS, launched the distribution of custom badges in the Soulbound Token (SBT) format to everyone who participated in the marathon dedicated to the launch of the Constructor. These badges serve as official confirmation of activity in the project and can play an important role in future drops, bonuses and participation in the ecosystem. To get your badge: ✅ You need to log in and go through the steps in the bot — @theontonbot ✅ Then go to your personal account on getgems.io ✅ Find GVWS SBT and click the Claim NFT button 😋The badge is displayed in three places at once: — in the GVWS profile — in ONTON — in Ton Society 💪 Participants who completed the marathon and already interacted with the ONTON bot received a push notification with the ability to brand. Those who did not participate in ONTON activities, but fulfilled the conditions of the marathon, will receive a notification later — via the bot @gvws_bot. More details: here #SBT#Marathon#TON#ONTON

🙏SBT ONTON in real time! 🔍 Our chat has a bot that monitors the emergence of new SBTs in real time — they appear instantly along with passwords! ❤️ No need to search for them in different chats anymore - just join our community and get valuable Soul Bound Tokens to your wallet, so that you can get a drop for them later! 🟣Claim your SBT ONTON now! #TON#ONTON#SBT#Airdrop#Web3#TONCommunity