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 слични објави

Пребарај: #filesystem

当前筛选 #filesystem清除筛选
GitHub Trends

@githubtrending · Post #14657 · 01.05.2025 г., 14:30

#c_lang#embedded#filesystem#microcontroller LittleFS is a file system designed for small devices like microcontrollers. It helps keep your data safe even if the power goes off suddenly. This is because it uses a "copy-on-write" system, which means it doesn't overwrite old data until the new data is safely stored. LittleFS also helps extend the life of your storage by spreading out writes across different areas, a process called wear leveling. This makes it very reliable and efficient for devices with limited memory and storage. https://github.com/littlefs-project/littlefs

GitHub Trends

@githubtrending · Post #14917 · 05.07.2025 г., 13:00

#rust#bigdata#cloud_native#distributed_systems#filesystem#minio#object_storage#oss#rust#s3 RustFS is a fast and safe distributed object storage system built with Rust, offering high performance and scalability for large data needs like AI and big data. It is compatible with S3, easy to use, and open source under the business-friendly Apache 2.0 license. Compared to others like MinIO, RustFS provides better memory safety, no risky data logging, and supports local cloud providers. You can quickly install it via a script or Docker, manage storage through a simple web console, and benefit from a strong community and detailed documentation. This makes RustFS a reliable, cost-effective choice for secure, scalable storage. https://github.com/rustfs/rustfs

GitHub Trends

@githubtrending · Post #15561 · 14.03.2026 г., 12:30

#python#agent#agentic_rag#ai_agents#clawbot#context_database#context_engineering#filesystem#llm#memory#openclaw#opencode#rag#skill OpenViking is a free open-source tool that acts as a context database for AI agents, using a simple file system to organize memories, resources, and skills under viking:// paths. It fixes issues like scattered data, high token costs, weak searches, and untraceable errors with tiered loading (L0 abstracts, L1 overviews, L2 details loaded on demand), recursive directory retrieval, visual traces, and auto-session memory updates. You benefit by building smarter, cheaper agents faster—like managing files—saving up to 96% on tokens while boosting task success by 50%+. https://github.com/volcengine/OpenViking