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

Резултати

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

Пребарај: #lensing

当前筛选 #lensing清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #277 · 15.09.2025 г., 20:11

🪐 In the galaxy cluster MACS J1206.2-0847, astronomers have mapped dramatic distortions of space-time caused by the cluster's enormous mass. This real effect, called gravitational lensing, bends and magnifies the light from even more distant galaxies behind it, turning MACS J1206.2-0847 into a cosmic lens that reveals objects otherwise hidden from our view. ✨ #spacetime⚡#mysteries⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #220 · 04.09.2025 г., 13:11

🪐 The James Webb Space Telescope has revealed the most detailed images yet of the galaxy cluster SMACS 0723, showing thousands of galaxies and ancient starlight that traveled over 4.6 billion years to reach us. Webb’s infrared vision lets us peer through dust and see cosmic structures, such as warped arcs of light caused by gravitational lensing—where the cluster’s mass bends and magnifies even more distant galaxies hiding behind it. ✨ #galaxies⚡#infrared⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #660 · 04.02.2026 г., 22:21

🪐 In 2023, astronomers used the gravity of the massive galaxy cluster SMACS J0723.3–7327 to create a powerful "gravitational lens," sharply magnifying and stretching light from galaxies over 13 billion light-years away. This natural lens effect, where space-time bends around clusters and distorts the background like a cosmic funhouse mirror, provides one of the clearest real-world examples of how gravity can twist the fabric of the universe and reveal objects otherwise hidden from view. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #478 · 04.11.2025 г., 22:21

🪐 In 2015, astronomers used data from the Atacama Large Millimeter/submillimeter Array (ALMA) to observe the gravitationally warped light from a distant galaxy called SDP.81. The galaxy's light was stretched and bent into a near-perfect ring by the immense mass of a foreground galaxy, creating a striking "Einstein ring"—a vivid demonstration of how gravity can distort space-time and transform a distant galaxy into a cosmic lens. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #293 · 18.09.2025 г., 20:11

🪐 In the galaxy cluster SDSS J1004+4112, astronomers have observed the light from a single supernova appear in multiple places at different times due to a powerful space-time distortion called gravitational lensing. This real effect means the cluster's massive gravity bends and splits the supernova's light into separate images, allowing telescopes to witness the same stellar explosion replayed across the sky—a cosmic demonstration of how gravity can twist the very fabric of space and time. ✨ #wormholes⚡#spacetime⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #57 · 01.08.2025 г., 16:11

🪐 The massive galaxy cluster Abell 370, situated about 4 billion light-years away in the constellation Cetus, acts as a colossal cosmic lens. Its immense gravity bends and magnifies the light from galaxies far beyond, creating spectacular arcs and distorted images that unveil some of the most distant and faint structures ever seen in the universe. ✨ #lensing⚡#galaxies⚡#cluster⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries

Universe Mysteries 🪐

@cosmomyst · Post #302 · 20.09.2025 г., 15:21

🪐 In the galaxy cluster El Gordo, astronomers have observed evidence that most of its mass is not from visible matter but from dark matter—a mysterious, invisible substance that outweighs all the galaxies and gas combined. Detailed gravitational lensing (where gravity bends and magnifies the light from more distant galaxies) reveals vast, hidden regions in El Gordo, confirming that dark matter acts as a cosmic glue, binding this colossal cluster together and shaping its structure on a grand scale. ✨ #darkmatter⚡#lensing⚡#galaxycluster⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #214 · 03.09.2025 г., 03:11

🪐 In the galaxy cluster Abell 1689, astronomers have observed light from distant galaxies being bent and stretched in strange ways—a real effect called "gravitational lensing." This phenomenon is caused when a huge mass, like the dense collection of galaxies in Abell 1689, distorts space-time itself—warping the paths of light and creating the illusion of arcs, rings, or even multiple images of the same object in the sky. ✨ #spacetime⚡#lensing⚡#clusters⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​

Universe Mysteries 🪐

@cosmomyst · Post #631 · 21.01.2026 г., 22:21

🪐 In the galaxy cluster Abell 1689, scientists have mapped how dark matter bends light from even more distant galaxies in a phenomenon called gravitational lensing. This cosmic "magnifying glass" effect lets astronomers trace the otherwise invisible dark matter—an unknown substance that reveals itself only through gravity, helping piece together how vast amounts of hidden mass shape entire clusters across the universe. ✨ #darkmatter⚡#abell1689⚡#lensing⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

Universe Mysteries 🪐

@cosmomyst · Post #260 · 12.09.2025 г., 03:11

🪐 Near the galaxy cluster Abell 370, astronomers have discovered evidence that space-time itself can be “distorted” on a huge scale, bending and stretching the paths of light from galaxies lying far behind the cluster. This real phenomenon, called gravitational lensing, reveals how massive objects can warp the very fabric of the universe and lets scientists study galaxies otherwise hidden from view—showing the true power of space-time distortions in action. ✨ #spacetime⚡#gravitational⚡#lensing⚡#abell370⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries ​