TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Hashtags

Резултати

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

Пребарај: #perception

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

@interesting_planet_facts · Post #632 · 26.08.2025 г., 13:22

🌎 The phenomenon of synesthesia allows some people to experience a blending of senses—like seeing colors when hearing music or tasting flavors from words. This rare trait reveals how flexible and interconnected the human brain’s sensory pathways can be. ✨ #neuroscience⚡#consciousness⚡#perception 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1336 · 11.03.2026 г., 12:11

🌎 Marathon runners often report “time expansion,” where minutes can feel much longer during intense effort. This phenomenon is linked to changes in dopamine levels in the brain, affecting how we sense passing seconds. Scientists have tracked measurable shifts in perceived time during both high physical exertion and tasks demanding intense attention. ✨ #time⚡#neuroscience⚡#perception 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1114 · 09.12.2025 г., 18:11

🌎 Time can seem to slow down or speed up based on emotional state. Studies show heightened fear, such as during accidents, leads people to recall more detail, but does not actually slow objective time. Experiments reveal our brain may stretch memory to make intense events feel longer, a phenomenon called time dilation. ✨ #neuroscience⚡#perception⚡#psychology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #972 · 27.10.2025 г., 22:11

🌎 The phenomenon of "temporal binding" describes how the brain knits together events that happen closely in time, making them feel like a single, unified event. Studies show people often judge actions and their effects as happening closer together than they really are, revealing how the human mind shapes our perception of time’s flow. ✨ #neuroscience⚡#psychology⚡#perception 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #938 · 20.10.2025 г., 12:11

🌎 Time perception can be dramatically altered by body temperature, with research showing people exposed to cold environments often overestimate how much time has passed. This effect is linked to changes in the brain’s internal clock, and studies found that participants in cold water estimated intervals were about 20% longer than in neutral conditions. ✨ #neuroscience⚡#psychology⚡#perception 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #644 · 28.08.2025 г., 13:22

🌎 Time can feel stretchy in our minds! In moments of stress or fear, your brain’s perception of time slows down—an effect called “time dilation.” The brain records more details during intense experiences, making events seem to last longer in memory. That’s why scary or thrilling moments feel like they stretch on forever, even though the real clock keeps ticking at its usual pace. ✨ #neuroscience⚡#psychology⚡#perception 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #670 · 01.09.2025 г., 18:22

🌎 Your sense of time can shift dramatically—scientists call these “time anomalies.” Strong emotions or new environments can make minutes feel like hours, or hours like seconds. This happens because your brain judges time based on how much information it’s processing, not by the clock. Moments packed with novelty or excitement seem longer, while routine days fly by unnoticed. ✨ #psychology⚡#perception⚡#brain 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1101 · 05.12.2025 г., 12:11

🌎 The phenomenon known as synesthesia causes some people to involuntarily link senses, such as perceiving numbers or letters as specific colors. Brain scans show increased cross-activity between sensory regions in synesthetes, and the trait is estimated to occur in about 4% of people. ✨ #neuroscience⚡#perception⚡#senses 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1050 · 18.11.2025 г., 18:11

🌎 Our sense of time is shaped by specialized brain regions, including the cerebellum, basal ganglia, and the right supplementary motor area. Research using brain imaging and patient studies shows damage to these areas can create time perception anomalies—such as feeling time stretch, shrink, or fragment unexpectedly. The cerebellum, once thought only to control movement, plays a key role in accurately judging short time intervals. ✨ #neuroscience⚡#perception⚡#anomalies 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #738 · 13.09.2025 г., 00:22

🌎 In rare cases, time perception can be distorted by neurological conditions such as temporal lobe epilepsy or brain injuries. People may report "time slowing down," déjà vu, or missing chunks of experience. Some individuals with temporal lobe seizures even describe feeling like time has stopped completely. ✨ #neuroscience⚡#perception⚡#anomalies 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1082 · 28.11.2025 г., 22:11

🌎 Your brain uses a region called the "suprachiasmatic nucleus" as its master clock, syncing your sense of time to light and dark cycles. Disruptions—like jet lag or shift work—can make time feel faster or slower, and this clock influences sleep, alertness, and body temperature rhythms. ✨ #perception⚡#neuroscience⚡#circadian 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1011 · 06.11.2025 г., 22:11

🌎 Certain types of migraine can cause "time dilation" or "time compression"—making minutes feel like hours or vice versa. Research links these time perception anomalies to abnormal brain activity in areas responsible for processing time and sensory input. Migraine auras affecting time sense have been documented in up to 15% of patients. ✨ #migraine⚡#neuroscience⚡#perception 👉subscribe Interesting Planet 👉more Channels ​

12
ПретходнаСтраница 1 од 2Следна