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

Резултати

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

Пребарај: #gadaa

当前筛选 #gadaa清除筛选
Addis Standard

@addisstandardeng · Post #21347 · 09.02.2026 г., 10:47

#Tribute: Professor Asmarom Legesse: Pioneer Scholar Who Illuminated the #Gadaa System to the World Professor Asmarom Legesse, the Eritrean-born anthropologist who redefined African democratic discourse, passed away on January 31, 2026, aged 94. In this tribute, Teferi Tafa notes the Harvard-trained scholar "spent over half a century documenting the #Oromo Gadaa system, dismantling colonial myths that dismissed indigenous #African governance as primitive." The author explains that Asmarom’s works revealed "a sophisticated constitutional order" featuring rotational leadership and term limits. He proved that Gadaa was "a highly developed system of checks and balances... that had governed Oromo society for centuries." Tafa emphasizes that Asmarom’s legacy of "intellectual decolonization" establishes him as a hero to the Oromo and a titan of global anthropology. https://addisstandard.com/?p=55081

Addis Standard

@addisstandardeng · Post #21319 · 05.02.2026 г., 12:15

#In_Memoriam: A Tribute to Professor Asmarom Legesse Asmerom Legesse (PhD), a pioneering scholar of the #Oromo Gadaa system, passed away at the age of 94. Born on 5 February 1931 in #Eritrea, he was widely respected for his rigorous and sustained studies of Oromo governance, now foundational to #African indigenous political thought. In this tribute, Ezekiel Gebissa writes that “for the Oromo people… death is not an ending but a passage from the world of binary reality to the realm of singularity.” Over nearly six decades, Asmerom reshaped African political studies by showing that #Gadaa is “not a relic of the past but a sophisticated, stable, and coherent democratic system.” Asmerom’s legacy remains the cornerstone of Oromo studies and global indigenous governance. https://addisstandard.com/?p=55020

Addis Standard

@addisstandardeng · Post #21309 · 04.02.2026 г., 14:38

News: Prominent #Oromo Gadaa scholar Asmerom Legesse passes away at 94 Asmerom Legesse (PhD), a distinguished scholar renowned for his pioneering research on the Oromo #Gadaa system, has passed away at the age of 94. Born on 5 February, 1931, in #Eritrea, Asmerom was widely recognized for his in-depth studies of Oromo traditions and governance, which have become foundational references for scholars of #African indigenous systems. In a statement, the Oromo Studies Association (#OSA) confirmed his death, expressing deep sorrow over the loss of a researcher described as a “kinsman of the Oromo people.” The association noted that Asmerom’s work on Oromo customs, history, and culture significantly advanced understanding of political and social systems across Africa. The Oromia Culture and Tourism Bureau expressed deep condolences, emphasizing that his life’s work preserved the Oromo Gadaa system and documented its practices for future generations, serving as.... Read more: https://addisstandard.com/?p=54991