@beautiful_theme · Post #1514 · 19.01.2019 г., 05:01
#Hazard | @Beautiful_Theme
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #197 · 4 јан.
Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep
Пребарај: #hazard
@beautiful_theme · Post #1514 · 19.01.2019 г., 05:01
#Hazard | @Beautiful_Theme
Hashtags
@Beautiful_edit · Post #104 · 15.05.2019 г., 11:02
#Hazard 🆔@Beautiful_Edit
Hashtags
@BEauTiful_TheMe · Post #997 · 11.07.2018 г., 10:30
#profile | #Hazard ➣ @Beautiful_Edit
@beautiful_theme · Post #1870 · 26.06.2019 г., 14:32
#Hazard | #هازارد 🎗@Beautiful_edit
@Beautiful_edit · Post #147 · 25.06.2019 г., 07:41
#Hazard | #هازارد 🎗@Beautiful_edit
@Beautiful_edit · Post #52 · 06.07.2018 г., 19:08
#profile | #Hazard ➣ @Beautiful_Edit
@cosmomyst · Post #316 · 23.09.2025 г., 12:21
🪐 Asteroid (2007) FT3 is a large near-Earth object, measuring about 340 meters across, that periodically comes close enough for astronomers to classify it as potentially hazardous. Its orbit is tracked because, though it poses no immediate danger, even objects this size could cause severe destruction if they ever collided with Earth—showing why scientists keep careful watch on these silent travelers. ✨ #asteroids⚡#hazard⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #170 · 22.08.2025 г., 03:11
🪐 The asteroid (33342) 1998 WT24, about half a kilometer wide, regularly makes close approaches to Earth, coming inside the orbit of Mercury every few years due to its highly elongated path. Its size and proximity earn it the label "potentially hazardous asteroid," so NASA keeps a close eye on it to ensure its orbit remains safely predictable. ✨ #asteroids⚡#hazard⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #92 · 07.08.2025 г., 00:11
🪐 The asteroid 99942 Apophis may get the most headlines, but there are over 2,300 "potentially hazardous asteroids" tracked by NASA's Sentry system, like (410777) 2009 FD and (144898) 2004 VD17. These objects, each large enough to cause serious regional damage if they ever struck Earth, are monitored for changes in their orbits to ensure they pose no imminent threat. ✨ #asteroids⚡#hazard⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #105 · 09.08.2025 г., 13:11
🪐 The asteroid (153814) 2001 WN5, roughly 1 kilometer across, will pass exceptionally close to Earth in 2028—only about 248,000 kilometers away, closer than the Moon. Because of its size and fast approach, 2001 WN5 is classified as a "potentially hazardous asteroid," meaning it could cause regional devastation if it ever struck our planet, so astronomers track its orbit with special care. ✨ #asteroids⚡#nearEarth⚡#hazard⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #91 · 06.08.2025 г., 20:11
🪐 The asteroid (99942) 2004 MN4, known as Apophis’s “cousin,” (163899) 2003 SD220, is a mountain-sized space rock that approaches Earth’s orbit about every December. Measuring roughly 1.6 kilometers long, its close passes remind scientists how even asteroids with well-known orbits can periodically come within just a few million kilometers of our planet, earning it a spot on NASA's list of potentially hazardous objects. ✨ #asteroids⚡#hazard⚡#nearEarth⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries
@cosmomyst · Post #458 · 26.10.2025 г., 12:21
🪐 One of the most closely monitored space objects threatening Earth is the asteroid (29075) 1950 DA, a kilometer-wide rock that will come unusually close to our planet in the year 2880. What makes 1950 DA especially concerning is its "rubble pile" structure, where its surface is held together more by weak forces between its grains than by gravity, making its behavior unpredictable if its path changes—so astronomers continually track it for any shift that could bring it closer to Earth in the future. ✨ #asteroid⚡#hazard⚡#monitoring⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels