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

Резултати

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

Пребарај: #domains

当前筛选 #domains清除筛选

🔥News from Freename!🔆 Web3 domain registrar Freename has added support for the new Base chain! Now you can acquire your unique domains and TLDs on BASE . Use them for your #Web3 identity, sending tokens, or creating websites compatible with traditional DNS. Enjoy new opportunities and expand your horizons with Freename! #Freename#BaseChain#Web3#Domains#TLDs#Blockchain#web3names#Key7Channel

GitHub Trends

@githubtrending · Post #15224 · 15.10.2025 г., 12:30

#html#digitalplat#domain#domain_platform#domainname#domains#free#freedomain You can get a free domain name from DigitalPlat FreeDomain with no cost or hidden fees. You just register a unique domain under extensions like .US.KG or .DPDNS.ORG and use any DNS provider you like, such as Cloudflare, to host your website. This helps you create your own online space without paying for a domain, making it easier and cheaper to start a website or project. Over 350,000 people already use it, and it’s supported by a nonprofit, so it’s trustworthy and open to everyone regardless of budget. https://github.com/DigitalPlatDev/FreeDomain

GitHub Trends

@githubtrending · Post #15229 · 16.10.2025 г., 12:30

#javascript#cloudflare#dns#domain#domains#free#free_domain#free_domains#free_for_dev#free_for_developers#github_pages#subdomain#subdomains#website You can get free subdomains for personal or open-source projects from Open Domains by registering through their GitHub repository. They offer several domain options with strong security features like SSL, HTTPS, and DNSSEC, ensuring your site is safe and reliable. You submit a pull request with your subdomain details, and after approval, your domain is ready to use, usually within minutes. This service is great if you want a free, easy-to-set-up web address for your project without buying a domain, saving you money and effort while maintaining good security and performance. Donations help keep the service running. https://github.com/open-domains/register