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

Резултати

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

Пребарај: #cvm

当前筛选 #cvm清除筛选
DOFH - DevOps from hell

@dofh_ru · Post #3570 · 05.02.2025 г., 17:54

Here we go again! SEV-SNP is vulnerable, again. New AMD SEV-SNP vulnerability: https://github.com/google/security-research/security/advisories/GHSA-4xq7-4mgh-gp6w Exploit: https://github.com/google/security-research/tree/master/pocs/cpus/entrysign Reports about two recent vulnerabilities in SEV-SNP memory encryption and isolation mechanism, on CPU pipeline, cache and branch prediction level: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3019.html https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3010.html AMD reported that previous approaches to Spectre class attacks will work to fix new vulnerabilities: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/tuning-guides/software-techniques-for-managing-speculation.pdf #cVM #TEE #SEV #SNP #SEV_SNP #AMD

#HaSab

@Hasab_2016 · Post #212 · 12.12.2025 г., 09:51

CVMA Student Wins Top Prize in Human Rights Essay Competition December 10, 2025 – Addis Ababa, Ethiopia In celebration of International Human Rights Day 2025, the Center for Human Rights, in collaboration with the UN Human Rights Office (OHCHR), has announced the winners of its essay competition titled “Our Everyday Essentials: Reclaiming Human Rights in the 21st Century.” We are proud to announce that Yared Ermiyas, a student from the College of Veterinary Medicine and Agriculture at Addis Ababa University, emerged as the first-place winner. His powerful essay, “Remove the Shadow,” eloquently argued that access to education must be a fundamental necessity for every child, not a matter of luck, highlighting the deep emotional and practical connection between education and a dignified life. Yared was awarded a mobile phone prize presented by H.E. Berhanu Adello, Chief Commissioner of the Ethiopian Human Rights Commission (EHRC). Commissioner Adello also extended an offer for Yared to begin an internship attachment at the National Bureau of the Human Rights Commission, providing a valuable opportunity for practical experience in the field. The awards ceremony featured a dynamic panel discussion where Yared and the other winners presented their essays and engaged with fellow students and audience members on critical issues related to freedom of expression and the right to education. The competition, which invited undergraduate students to reflect on the core human rights that shape our daily lives, successfully inspired thoughtful dialogue and showcased the intellectual talent within our university community. Congratulations to Yared Ermiyas and all the participants for raising your voices, sharing your vision, and helping to shape the future of human rights! Via Hailu Beyene CVMA Student President @campus_Voice_2016 #OurEverydayEssentials#HumanRightsDay2025#StudentVoice#AAU#CVM#Congratulations