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

Пребарај: #cleanpower

当前筛选 #cleanpower清除筛选
Rosatom Global

@rosatom_global · Post #123 · 20.08.2025 г., 10:26

🌟 Celebrating 80 Years of the Russian Nuclear Industry! 🌟 Today marks a historic milestone — the 80th anniversary of the Russian nuclear industry. It’s not just a story of technology and science, but of vision, resilience, and the determination to transform challenges into opportunities for the future. ⚛️ Breakthroughs that redefined possibility The Russian nuclear industry became a leader in the peaceful use of atomic energy. The world's first nuclear power plant in Obninsk was launched, created the first nuclear icebreaker and tokamak. 🚀 Rosatom today Today, the State Corporation "Rosatom" creates advanced technologies for a wide range of industries: today the state corporation not only builds nuclear power plants, providing clean energy to the country and the world, but also creates new materials — super-strong, environmentally friendly, helps develop the Arctic and the Northern Sea Route, develops nuclear medicine methods to defeat incurable diseases, advances quantum technologies to solve global human problems. 👨‍👩‍👧‍👦 A dream for the future Today, the nuclear industry has a big new dream — a long and healthy life for people through clean atomic energy, advanced nuclear medicine methods, new materials, and modern digital technologies. 🌍 We dream of a world where energy is limitless, life is healthier, and humanity thrives. And together, we will make this dream a reality. We are proud & happy! ✨ #NuclearEnergy#CleanPower#Innovation#SustainableFuture

Venture Village Wall 🦄

@venturevillagewall · Post #3646 · 21.12.2024 г., 10:24

Accelergen Energy Raises $20M Accelergen Energy has secured $20 million in funding as of December 19, 2024. The firm focuses on delivering clean power assets characterized by robust and sustainable locational value through strategic investments, development, commercialization, and optimized operations. For more details, visit Accelergen Energy. #Accelergen#Energy#Funding#CleanPower#Investment#Sustainability#RenewableEnergy#Development#Commercialization#Operations#ClimateTech#GreenEnergy#Ecosystem#Infrastructure#PowerAssets#Technology#StrategicInvestment#CleanTech#EcoFriendly#LocationalValue