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

Резултати

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

Пребарај: #losangeles

当前筛选 #losangeles清除筛选
ℭ𝔬𝔪𝔟𝔞𝔱𝔩𝔳𝔩™

@realcombatlvl · Post #24622 · 04.08.2025 г., 02:15

🇺🇸#LosAngeles. Wild teens ransack Chevron store in Lincoln Heights in broad daylight. Another SoCal store is taken over by rampaging teens racksacking aisles, grabbing whatever they can. This time, a Lincoln Heights Chevron station is hit. The frustrated store managers who want police to do more to stop the takeovers. Follow us -> LiveLeak

Hashtags

Dr Sherri Tenpenny

@SherriTenpenny · Post #24757 · 19.04.2026 г., 05:24

This is absolutely disgusting and heartbreaking. Homeless addicts on Skid Row in LA are using innocent dogs to test their drugs for fentanyl. These poor animals are being fed deadly substances, abused, neglected, sold for drugs, and thrown away like trash. Volunteers from Starts With One Today are risking their lives to rescue these dogs with zero support from the city. How has Mayor Karen Bass and LA leadership let this horror continue? Animals are suffering and dying in plain sight while officials do nothing. This is pure cruelty. Where is the outrage? Where is the action? #SaveSkidRowDogs#AnimalAbuse#LosAngeles 🔹👉🏻@SherriTenpenny

Jeffery Mead

@the_jefferymead · Post #507 · 19.02.2026 г., 05:55

PERFECT RING FORMED OVER LOS ANGELES This appeared high above L.A. just after dusk. A bright linear trail stretched across the sky — and around it, a smooth circular arc expanded and held its shape. The symmetry is what stands out. A straight line through the center. A clean curve wrapping around it. It lingered long enough for people across the city to stop and stare. Los Angeles, California. Did you catch this from where you are? MrMBB333 👇 Drop your city. #MrMBB333#SkyWatch#LosAngeles

AI match predictions

@ai_match_prediction · Post #12028 · 10.05.2026 г., 13:05

USA Major League Soccer🇺🇸 2026-05-10 20:30 UTC New York City FC vs. Columbus Crew Predicted outcome: New York City FC✅ Predicted score: 3:2 Actual: New York City FC 3:0 #NewYorkCity#ColumbusCrew 2026-05-10 23:00 UTC Minnesota United FC vs. Austin Predicted outcome: Minnesota United FC❌ Predicted score: 2:1 Actual: Draw 2:2 #MinnesotaUnited#Austin 2026-05-11 01:00 UTC Los Angeles FC vs. Houston Dynamo Predicted outcome: Los Angeles FC❌ Predicted score: 2:1 Actual: Houston Dynamo 1:4 #LosAngeles#HoustonDynamo #Football#USAMLS

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