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

Резултати

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

Пребарај: #techregulation

当前筛选 #techregulation清除筛选
AI & Law

@ai_and_law · Post #267 · 21.03.2024 г., 08:04

Civil Society Urges Action on EU AI Act Implementation In response to the recent vote on the AI Act, various civil society organizations, including Foxglove, ARTICLE 19, the Mozilla Foundation, and the Irish Council for Civil Liberties, have voiced their perspectives on the regulation. Emphasizing the urgency of the matter, they highlight the risks posed by the dominance of major tech corporations in the AI sector. These organizations underscore the importance of swift action to address unchecked corporate power, particularly in the realm of artificial intelligence. They advocate for robust enforcement of competition rules to safeguard democracy and public interests against potential threats arising from concentrated control within the tech industry. #AIAct#CivilSociety#TechRegulation

AI & Law

@ai_and_law · Post #742 · 14.01.2026 г., 08:04

🌐📖Responsible AI Governance in 2025: From Principles to Practice The Responsible AI Governance Network (RAGN) published "The 2025 Responsible AI Governance Landscape: From Principles to Practice" in December 2025. The report maps how AI governance evolved during 2025, highlighting five major shifts: the EU AI Act moving into enforcement, the coexistence of three non-converging governance models, the rise of board-level accountability, tensions between frontier and open-source AI, and courts increasingly shaping standards through litigation. The report includes sector-specific snapshots for healthcare, HR, finance, and public procurement, and examines the operational cost of AI governance, including staffing, tooling, and audits. It also provides a 30–60–90 day implementation roadmap with a maturity self-assessment designed for organizations deploying or overseeing AI systems. The publication documents concrete governance practices observed in 2025, such as cross-functional governance teams, continuously updated documentation, CI/CD-integrated controls, independent audits for high-risk systems, and ongoing monitoring instead of one-off assessments. It also identifies common implementation failures, including checkbox compliance, fragmented tooling, accumulated documentation debt, and governance processes that exist only formally. #AIandLaw#ResponsibleAI#AIGovernance#EUAIAct#AICompliance#TechRegulation

AI & Law

@ai_and_law · Post #452 · 27.11.2024 г., 08:04

Protecting Freedom of Expression within the AI Act Framework In a recent op-ed for Tech Policy Press, Jordi Calvet-Bademunt, Senior Research Fellow at The Future of Free Speech, delves into the AI Act’s potential impact on freedom of expression. With new requirements for assessing and mitigating systemic risks tied to high-impact AI, the Act aligns with the Digital Services Act (DSA) approach but introduces significant challenges. Providers of general-purpose AI now face complex responsibilities in balancing various fundamental rights. A misstep in judgment may lead to excessive content removal, as companies seek to avoid potential penalties—a trend that could inadvertently curb free speech, particularly for contentious viewpoints. As the European Commission prepares to enforce the Act, concerns are rising about the role of political influence in managing what constitutes "public security." Past examples, like then-Commissioner Breton’s statements advocating platform shutdowns during unrest, underline the risks associated with broad regulatory powers. The upcoming General-Purpose AI Code of Practice, set to accompany the Act, presents a vital opportunity for establishing protections that better secure freedom of expression. #AIGovernance#FreeSpeech#TechRegulation#AIAct#DigitalRights