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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте future-функция, которую я использовал, это абсолютный импорт from __future__ import absolute_import Что она делает? Изменения, которые вносит эта инъекция описаны в PEP328 Покажу простой пример. Допустим, есть такой пакет: /my_package /__init__.py /main.py /string.py Смотрим код в my_package/main.py # main.py import string Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта: 1. модуль в моём пакете my_package.string 2. стандартный модуль string И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string. Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать. from my_package import string или относительный импорт, но с указанием пути относительно текущего модуля main from . import string Еще одной неоднозначностью меньше 😎 Подробней про импорты здесь: https://docs.python.org/3/tutorial/modules.html #2to3#pep#basic

Резултати

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

Пребарај: #actions

当前筛选 #actions清除筛选
科技&趣闻&杂记

@kejiqu · Post #3685 · 06.08.2025 г., 01:46

新 AI 编程伙伴:Gemini CLI GitHub Actions 谷歌推出了 Gemini CLI GitHub Actions,这是一个免费的 AI 编程工具,用于 GitHub 代码库。 该工具可在代码库中执行安全扫描、测试,并提供补丁建议。 Gemini CLI GitHub Actions 旨在作为关键流程的自主代理,旨在提高开发效率。该工具不收取任何费用。The Keyword 🏷#Gemini#CLI#GitHub#Actions#AI#编程 📢频道👥群组📝投稿

GitHub Trends

@githubtrending · Post #15481 · 09.02.2026 г., 11:30

#go#actions#cai#ci#claude_code#codex#copilot#gh_extension#github_actions GitHub Agentic Workflows let you write simple markdown instructions in natural language to automate repo tasks like triaging issues, fixing CI failures, generating reports, and improving code—running safely as GitHub Actions with AI like Copilot or Claude. Strong guardrails ensure read-only access by default, sandboxed execution, and human-reviewed outputs via pull requests. This saves you time on repetitive work, boosts efficiency with adaptive AI decisions, and keeps everything secure without complex YAML coding. https://github.com/github/gh-aw

GitHub Trends

@githubtrending · Post #15174 · 27.09.2025 г., 13:00

#typescript#actions#authentication#gcp#github_actions#google_cloud#google_cloud_platform#iam#identity#security You can securely connect GitHub Actions to Google Cloud using the Google GitHub Action called `auth`. It supports two main ways: the recommended Workload Identity Federation (WIF), which uses short-lived tokens and avoids long-lived service account keys, and the older Service Account Key JSON method. WIF improves security by creating a trust link between your GitHub workflow and Google Cloud without exposing permanent credentials. To use it, you set up a Workload Identity Pool and Provider in Google Cloud, then configure your GitHub workflow to authenticate with these. This lets your workflows access Google Cloud resources safely and easily, reducing risks and simplifying credential management. https://github.com/google-github-actions/auth