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

Резултати

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

Пребарај: #genocidal

当前筛选 #genocidal清除筛选
MessageInABottle

@mib_messageinabottle · Post #6922 · 24.05.2024 г., 15:56

International Court of Justice (#ICJ ) has finally had enough of #Israelis and their #genocidal actions against the #Palestinians of Gaza It has finally decided to do what #SouthAfrica demanded it should have done months ago: • Demand that the #ZioNazis halt their #genocidal slaughter of innocents in #Gaza and that • Israel must ensure access to Gaza for UN genocide investigators

MessageInABottle

@mib_messageinabottle · Post #6961 · 26.05.2024 г., 15:16

UN rapporteur: Israel will not stop ‘this madness’ until we make it stop Francesca #Albanese, the #UN’s special #rapporteur on #Palestine on Saturday urged member states to impose sanctions on #Israel along with an arms embargo until it stops “this madness,” “Let’s be clear. As the #ICJ orders Israel to stop its offensive in #Rafah, #Israel instead intensifies its attacks on it,” The International Court of Justice (#ICJ) in its latest ruling ordered Israel to immediately halt its military offensive in #Rafah, a city in southern Gaza where more than 1.5 million displaced Palestinians had sought refuge. “The news I am receiving from the people trapped therein are terrifying, Be sure: Israel will not stop this madness until WE make it stop,” Albanese urged all UN member states to impose #sanctions, arms #embargo and suspend diplomatic and political relations with Israel until it ceases its #genocidal assault.

MessageInABottle

@mib_messageinabottle · Post #6824 · 20.05.2024 г., 10:55

A legal group submitted to the #UN the most thorough legal analysis of Israel's actions concluding it is committing genocide against Palestinians in Gaza. This is probably the most complete report to date that demonstrates how #Israel's attacks on #Palestinians in #Gaza meet the legal definition of #genocide. It's a 100-page report, by legal experts at #Boston University School of Law, #Cornell Law School, #Yale Law School, and others. The report's conclusion: "Israel has committed the #genocidal acts of #killing, causing serious harm to, and inflicting conditions of life calculated to bring about the physical #destruction of #Palestinians in #Gaza, a protected group that forms a substantial part of the Palestinian people. These #genocidal acts have been motivated by the requisite genocidal intent, as evidenced in this report by the statements of #Israeli leaders, the character of the State and its forces’ conduct against and relating to Palestinians in Gaza, and the direct nexus between them."