TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #309 · 2 фев.

Метод строки split() разделяет строку на несколько строк по указанному символу >>> "a_b_c".split('_') ['a', 'b', 'c'] Можно указать максимальное количество разделений >>> "a_b_c".split('_', 1) ['a', 'b_c'] Или резать с другой стороны с помощью rsplit() (right split) >>> "a_b_c".rsplit('_', 1) ['a_b', 'c'] А что будет если оставить аргументы пустыми? >>> "a_b_c".split() ['a_b_c'] Получаем список с одним элементом, потому что по умолчанию используется пробельный символ. >>> "a b c".split() ['a', 'b', 'c'] То есть это равнозначно такому вызову? >>> "a b c".split(" ") ['a', 'b', 'c'] Кажется да, но нет! Давайте попробуем добавить пробелов между буквами >>> "a b c".split(" ") ['a', '', '', 'b', '', '', 'c'] И вот картина уже не так предсказуема 😕 А вот что будет по умолчанию >>> "a b c".split() ['a', 'b', 'c'] Всё снова красиво! 🤩 По умолчанию в качестве разделителя используется любой пробельный символ, будь то табуляция или новая строка. Включая несколько таких символов идущих подряд. А также игнорируются пробельные символы по краям строки. >>> "a\t b\n c ".split() ['a', 'b', 'c'] Аналогичный способ можно собрать с помощью регулярного выражения. Но пробелы по краям строки придется обрабатывать дополнительно. >>> import re >>> re.split(r"\s+", ' a b c '.strip()) ['a', 'b', 'c'] Здесь тоже можно указать количество разделений >>> re.split(r"\s+", 'a b c', 1) ['a', 'b c'] А что если мы хотим написать красиво, то есть split() без аргументов, но при этом указать количество разделений? В этом случае первым аргументом передаём None >>> "a\n b c".split(None, 1) ['a', 'b c'] Данный метод не учитывает строки с пробелами, взятые в кавычки 'a "b c" '.split() ['a', '"b', 'c"'] Но для таких случаев есть другие способы. #tricks#basic

Резултати

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

Пребарај: #digitalpolicy

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

@ai_and_law · Post #802 · 08.04.2026 г., 07:04

🇪🇺EU AI Act FAQ Updated with Guidance on Agentic AI The European Commission’s AI Act Service Desk added a new section on agentic AI to its FAQ guide under the AI Pact. The update introduces key definitions related to “AI agents” and “agentic AI” and outlines how such systems are addressed within the AI Act framework. The guidance highlights that existing AI Act provisions apply to agentic AI, with particular emphasis on Article 5(1) prohibitions concerning harmful manipulation and exploitation of vulnerabilities, identifying these rules as especially relevant for this category of systems. #AIRegulation#EUAIAct#AgenticAI#AIgovernance#DigitalPolicy

AI & Law

@ai_and_law · Post #636 · 15.08.2025 г., 07:04

🇩🇪Germany’s Digital Minister Calls for a Leaner, More Innovation-Friendly AI Act Germany’s Federal Minister for Digital Transformation and Government Modernisation, Karsten Wildberger, has voiced sharp concerns over the EU AI Act, describing it as “overloaded and too complex.” Speaking to Euractiv, he argued that while addressing risks is essential, the current regulatory framework imposes excessive bureaucracy that could hinder innovation. Wildberger backed the European Commission’s plan to create AI training hubs, or “gigafactories,” as a step toward strengthening Europe’s technological capacity. His position underscores a tension within EU policymaking—balancing robust safeguards with an enabling environment for AI development. #AIRegulation#EUAIAct#Germany#DigitalPolicy

AI & Law

@ai_and_law · Post #806 · 14.04.2026 г., 07:04

📖How Metaphors Shape AI Regulation A research paper by the Centre for Digital Ethics (CEDE), “The Artificial in ‘Artificial Intelligence’: How Imagination Shapes AI Regulation,” examines how metaphorical language influences legal and regulatory approaches to AI. Drawing on cognitive linguistics, the paper argues that concepts such as “intelligence,” “black box,” and “hallucination” are not neutral descriptors but frameworks that shape how risks, responsibility, and authority are understood. The authors highlight that legal interpretation relies on language with normative force, meaning these metaphors can steer regulatory outcomes and create path dependence. For example, “intelligence” encourages anthropomorphism, “black box” narrows focus to the model rather than the broader system, and “hallucinations” mischaracterize predictable errors as anomalies. The paper proposes reframing such errors as design-related risks arising from system features and interaction dynamics. #AIRegulation#AIethics#LegalTheory#AIGovernance#DigitalPolicy

AI & Law

@ai_and_law · Post #796 · 31.03.2026 г., 07:04

🇪🇺EU Rights Bodies Warn on AI Act Amendments in Digital Omnibus Equinet and ENNHRI issued a joint statement raising concerns over proposed amendments to the AI Act within the Digital Omnibus package. The organizations state that changes are being advanced without sufficient impact assessments or public consultation, potentially affecting fundamental rights protections. They also highlight that the AI Act only entered into force on 1 August 2024, with most obligations applying from 2 August 2026, making meaningful assessment of its effects premature. The statement stresses the European Commission’s obligations under EU Treaties and Better Regulation Guidelines to ensure transparent consultation and evidence-based policymaking. It also warns that simplifying regulation based on company size rather than AI system risk could have systemic consequences, given the dominance of SMEs and Small Mid-Caps in the EU economy. Equinet and ENNHRI recommend preserving core safeguards, including AI system registration, powers of fundamental rights authorities, high-risk system timelines, strict necessity standards, AI literacy obligations, and key information requirements. They also oppose weakening GDPR definitions of personal data and proposed changes to automated decision-making rules. #AIRegulation#EUAIAct#FundamentalRights#DigitalPolicy#GDPR