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

Резултати

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

Пребарај: #iof

当前筛选 #iof清除筛选
Freedom Flotilla Coalition

@FFC_official_channel · Post #525 · 10.06.2025 г., 18:49

Some snippets from Greta’s interview after being deported by Israeli authorities. Continue fighting for Palestinians in Gaza, including those in wider Palestine who are unlawfully imprisoned, including over 400 children. #Madleen#IOF#GretaThunberg#FreedomFlotilla

Freedom Flotilla Coalition

@FFC_official_channel · Post #538 · 11.06.2025 г., 20:39

Lara, speaking from Brazil, has had no contact with her husband, Thiago Ávila, since he was abducted and detained illegally by Israeli forces from the 'Madleen'. Since then, Thiago has been placed in solitary confinement, denied communication with his family. According to Lara, Israeli authorities threatened Thiago with the psychological torment of isolation without light or ventilation. Despite this, Thiago remains on hunger strike, holding firm to his belief in justice for Palestinians and the right of every child to food, safety, and freedom. From his prison cell, he wrote a letter to his 1-year-old daughter. Lara generously shares that with us today. This is a call not just for Thiago’s release—but for the world to pay attention to Gaza, to Palestine, and to all people who are exploited, forced to live under occupation. #FreedomFlotilla#Madleen#Thiago#IOF#WeWillSail#BreakIsraelsSiege#EndTheBlockade

Freedom Flotilla Coalition

@FFC_official_channel · Post #502 · 09.06.2025 г., 12:06

Freedom Flotilla Official Update: It's time for our governments to do their jobs and sanction Israel. Its illegal attack on 'Madleen' while sailing in international waters is a small extension of their war crimes in Gaza. Governments, institutions, media, and corporations must stop protecting Israel, now. They must stop prioritising profit over human lives, now. Protect our volunteers while protecting Palestinians in Gaza and wider Palestine. #BreakIsraelsSiege#EndTheBlockade#Madleen#FreedomFlotilla#Volunteers#IOF#StandWithGaza#StandWithPalestine

Freedom Flotilla Official Update: It's time for our governments to do their jobs and sanction Israel. Its illegal attack on 'Madleen' while sailing in international waters is a small extension of their war crimes in Gaza. Governments, institutions, media, and corporations must stop protecting Israel, now. They must stop prioritising profit over human lives, now. Protect our volunteers while protecting Palestinians in Gaza and wider Palestine. #BreakIsraelsSiege#EndTheBlockade#Madleen#FreedomFlotilla#Volunteers#IOF#StandWithGaza#StandWithPalestine

Freedom Flotilla Coalition

@FFC_official_channel · Post #561 · 13.06.2025 г., 20:57

Yanis Mhamdi, from his prison cell: “If I had to do it all over again, I'd do exactly the same thing”. Illegally detained in Israel since the attack on the “Gaza Freedom Flotilla” in international waters, journalist Yanis Mhamdi sent us a letter, written from his prison cell, before news had reached him of a possible one month extension due to Israel's attacks on Iran. #BreakIsraelsSiege#EndTheBlockade#WeWillSail#IsraelIran#IOF#Madleen#FreedomFlotilla#RimaHassan#YanisMhamdi

Freedom Flotilla Coalition

@FFC_official_channel · Post #207 · 11.08.2024 г., 16:17

"Families of Gaza are not less important than my family. It’s by mere chance that we are not one of those families that are in Gaza right now." Thiago Ávila, father and activist aboard 'Handala', will sail towards Gaza with an urgent mission: to break the illegal siege and stand with the children of Gaza. 'Handala' is a small boat, but it carries the weight of a global uprising for justice. As catastrophic famine unfolds across Gaza, evidence of heinous sexual and physical violence by the IOF continues to emerge, and the Israeli and U.S.-backed genocide persists with impunity, people power is more integral than ever—it’s up to us to shape a new society. The world must not turn its eyes away. Keep your eyes on 'Handala'. Share our mission, amplify Palestinian voices, and do everything you can to stand for Gaza. The flood of change is coming—be part of it. #FreedomFlotilla#Handala#FreePalestine#Gaza#AllEyesOnDeck#FreeGaza#WeWillSail#Thiago#Brazil#HumanRights#Genocide#IOF

Freedom Flotilla Coalition

@FFC_official_channel · Post #215 · 19.08.2024 г., 21:03

Our objectives—to break the blockade and raise awareness of the genocide against Palestinians in Gaza—remain unchanged. We will provide updates on our next departure when we are ready to sail again. In the meantime, we urge you to join the #NoHarbourForGenocide campaign to take action against the siege on Gaza by opposing every country and company complicit in this genocide. #handala#ffc#freedomflotillacoalition#freegaza#freepalestine#endtheoccupation#breakthesiege#endtheblockade#iof#warcrimes#icc#icj