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

Резултати

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

Пребарај: #usai

当前筛选 #usai清除筛选
Papa & Vaticano - News

@papaevaticanonews · Post #9520 · 02.03.2026 г., 15:58

“Il conflitto in crescita rischia di sfociare in una guerra regionale più ampia”. Con queste parole mons. Paul S. Coakley, arcivescovo di Oklahoma City e presidente della Conferenza episcopale degli Stati Uniti (Usccb), ha chiesto agli #USAi, all’#Iran e all’intera comunità internazionale di tornare al dialogo e di percorrere ogni strada verso una pace giusta e duratura. Facendo proprie le parole di Papa #LeoneXIV – che all’Angelus di ieri ha invitato a fermare “la spirale della violenza prima che diventi una voragine irreparabile” e a promuovere “il bene dei popoli, che anelano a una convivenza pacifica, fondata sulla giustizia” – il presule ha rivolto “un appello accorato a tutte le parti coinvolte perché la diplomazia riacquisti il suo ruolo” e ha chiesto “una cessazione della spirale della violenza” e un ritorno al “coinvolgimento diplomatico multilaterale”. Mons. Coakley ha quindi invitato “i cattolici e tutti gli uomini di buona volontà a continuare le ardenti preghiere per la pace in Medio Oriente, per la sicurezza delle truppe e degli innocenti”, affidando il mondo all’intercessione di Maria, “Regina della pace”.

AI & Law

@ai_and_law · Post #724 · 16.12.2025 г., 08:04

🇺🇸U.S. Executive Order Signals Federal Preemption in AI Policy President Donald Trump has signed a new Executive Order aimed at implementing the U.S. AI Action Plan and removing what the administration views as barriers to American leadership in AI. The Order represents the White House’s second effort to limit state-level AI regulation, following the Senate’s rejection of a proposed 10-year moratorium. It frames extensive state AI laws as a legal and strategic risk, arguing that fragmented regulation across states could undermine innovation and national competitiveness. The Order advances federal authority through three core rationales. First, it argues that AI companies must operate without burdensome, inconsistent state rules, particularly given the absence of a comprehensive federal AI law and the existence of over 1,000 state-level AI bills. Second, it targets state laws that, in the administration’s view, mandate “ideological bias” in AI systems, framing such requirements as potentially violating the Federal Trade Commission Act’s ban on unfair or deceptive practices. Third, it establishes an AI Litigation Task Force within the Department of Justice to challenge state AI laws deemed to unlawfully regulate interstate commerce, conflict with federal policy, or otherwise be unlawful in the Attorney General’s judgment. Together, these measures consolidate regulatory control at the federal level while deferring the adoption of a comprehensive national AI statute. The Executive Order positions federal enforcement and preemption as the primary tools for shaping U.S. AI governance, with significant implications for the future role of state-level AI regulation. #AIRegulation#USAI ##AIPolicy#AILaw

AI & Law

@ai_and_law · Post #631 · 08.08.2025 г., 07:04

🇺🇸White House Centralizes AI Policy Resources in New Online Hub The White House has launched a dedicated AI policy website, consolidating key U.S. federal actions on artificial intelligence. Other useful relevant documents on US AI policy: ✔️Promoting the Export of the American AI Technology Stack ✔️Accelerating Federal Permitting of Data Center Infrastructure ✔️Removing Barriers to American Leadership in Artificial Intelligence ✔️Advancing Artificial Intelligence Education for American Youth ✔️Preventing Woke AI in the Federal Government ✔️Restoring Common Sense to Federal Procurement #USAI#ExecutiveOrders#AIGovernance#WhiteHouse

12
ПретходнаСтраница 1 од 2Следна