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

Пребарај: #canyon

当前筛选 #canyon清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #927 · 17.10.2025 г., 22:11

🌎 Hidden off the Pacific coast of California, the Point Dume Submarine Canyon plunges over 800 meters deep just a short distance from shore. Scientists have discovered mysterious methane seeps and rare deep-sea corals within the canyon. These underwater features support unique ecosystems not found anywhere else nearby. ✨ #ocean⚡#canyon⚡#ecosystems 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #777 · 18.09.2025 г., 20:22

🌎 In Serbia’s Vratna Canyon, stone arches called natural bridges tower up to 30 meters high. These rare formations result from rivers slowly eroding the limestone over millennia, leaving behind immense rock spans. Only three such natural bridges exist in the canyon, making it one of Europe’s most unusual geological sites. ✨ #geology⚡#Serbia⚡#canyon 👉subscribe Interesting Planet ​

🌄🌿Blyde River Canyon — a 26 km (16 mi) natural wonder in Mpumalanga Province, northeastern South Africa. It is one of the largest canyons in the world, but unlike the Grand Canyon in the USA, it is covered with lush subtropical vegetation, earning it the name “Green Canyon”. 🌱💚 🏞 The canyon is part of the Blyde River Canyon Nature Reserve. 🌅 In local languages, Mpumalanga means The Place Where the Sun Rises. 🤝 In 2022, the Sverdlovsk Region and Mpumalanga signed a cooperation agreement. 📸 Photos: istockphoto.com #Nature#Tourism#SouthAfrica#Travel#Canyon#BlydeRiverCanyon#Mpumalanga#Africa#Sverdlovsk

🗺 Travel the World | Private Expeditions

@expeditionsworldwide · Post #488 · 03.07.2023 г., 13:03

🫶 Dear subscribers! We delighted that you're following our channel! On our channel, you'll find everything about travel! By using hashtags, you can easily find the content that interests you. CHANNEL CONTENT: 📹#videoclips 🧭#expedition 🏔️#hiking 🤿#diving 🧨#unusualplaces ⛩#bridges 🏔#mountains ⌛️#facts ✈️#airplanecemeteries 🗻#hills 🏜#discoveries 🏖#beaches 🈴#China 🕌#India 💒#temples 🏤#architecturalmasterpieces 🚆#journeys 🏜#vacations 🎇#UNESCO ⛰#cliffs 🌋#canyon 🌊#lakes 🏢#skyscrapers ⛲️#waterfalls ⛴#dam 🏕#inaccessibleplaces 🌋#volcano 🚀#traveladvice 🌊#sea 🌲#forest 🏝#island 🌅#desert 🌫#ponds ⛰#cave ⭐️#travelhacks ⛺️#nationalpark Thank you for being a part of our travel community! Happy exploring! 🪐Discover upcoming expeditions — https://4elementos.shop