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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #397 · 12 ное.

Использование Pydantic сегодня стало нормой, и это правильно. Но иногда на ревью вижу, что используют его не всегда корректно. Например, метод BaseModel.model_dump() по умолчанию не преобразует стандартные типы, такие как datetime, UUID или Decimal, в простой сериализуемый для JSON вид. Тогда пишут кастмоный сериализатор для этих типов чтобы функция json.dump() не падала с ошибкой. import uuid from datetime import datetime from decimal import Decimal from uuid import UUID from pydantic import BaseModel class MyModel(BaseModel): id: UUID date: datetime value: Decimal obj = MyModel( id=uuid.uuid4(), date=datetime.now(), value='1.23' ) print(obj.model_dump()) # не подходит для json.dump # { # 'id': UUID('4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1'), # 'date': datetime.datetime(2025, 12, 12, 12, 12, 12, 111111), # 'value': Decimal('1.23') # } # добавляем свой кастомный сериализатор json.dumps(obj.model_dump(), cls=MySerializer) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2025-12-12T12:12:12.111111', # 'value': '1.23' # } В данном случае класс MySerializer обрабатывает datetime, UUID и Decimal. Например так: class MySerializer(json.JSONEncoder): def default(self, o): if isinstance(o, Decimal): return str(o) elif isinstance(o, datetime): return o.isoformat() elif isinstance(o, UUID): return str(o) return super().default(o) Специально для тех, кто всё еще так делает - в этом нет необходимости! Pydantic может это сделать сам, просто нужно добавить параметр mode="json". json.dumps(obj.model_dump(mode="json")) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2012-12-12T12:12:12.111111', # 'value': '1.23' # } #pydantic#libs

Резултати

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

Пребарај: #arm64

当前筛选 #arm64清除筛选
垃圾场频道

@lajichangeu · Post #57 · 29.06.2022 г., 03:28

Version: 0.24.9.1530-arm64-v8a Commit: a0dc1b0d, 16/06/2022, 08:31 UTC MD5: 8a7b9fc07657163d2b26ed193e1f21c0 SHA-1: 1ce73e5e0d9c04487691cc9b468c692e9a758c08 SHA-256: dd5251bb3e6329e724cce752d9468d7f490400a2bea0433e4506b2960117629f #arm64#stable#apk

Alexa Mods

@itsmealexaliza · Post #1150 · 17.03.2025 г., 18:50

🚀 HappyMod 3.1.6c [ADSFREE + VIP] 🔥 🔹 Version: 3.1.6c 🔹 Architecture: ✅ ARMv7 & ✅ ARM64-v8a Supported 🔹 Size: [File Size] ✨ MOD Features: ✅ No Ads – Enjoy an ad-free experience! ✅ VIP Unlocked – Premium features activated! ✅ High-Speed Downloads – Faster and more stable! ✅ Fully Tested – Safe & secure to use! 📌 About HappyMod: HappyMod is the ultimate marketplace for modded Android apps & games. Get access to thousands of modded APKs with premium features unlocked! 📥 Download Now: 📢 Join Our Telegram for Updates & Support! #HappyMod#ModAPK#VIPUnlocked#AndroidMods#ARM64#ARMv7

Alexa Mods

@itsmealexaliza · Post #1194 · 27.07.2025 г., 03:29

HappyMod 3.2.1 [ADSFREE + VIP + x86 + MODDED] App Info: - Version: 3.2.1 - Architecture: ARMv7 | ARM64-v8a | x86 - Release Date: 2025-07-21 (Latest 360加固) - Size: 20 MB - Modder: alexaliza [AlexaMods] MOD Features: - Unlimited Downloads – No speed or file limits. - Ads Free – Clean interface without ads. - VIP Unlocked – Access all premium & exclusive content. - Latest 360加固 2025-07-21 Signature Killed & Repacked. - Premium Mods Access – Thousands of exclusive modded apps/games. - 100% Safe – Play Protect Verified (No malware or trojans). About HappyMod: HappyMod is the #1 platform for modded Android apps and games, offering verified, safe, and premium APKs with exclusive features. Join Our Telegram for Updates: https://t.me/itsmealexaliza #HappyMod#ModAPK#VIPUnlocked#AlexaMods#ADFree#AndroidMods#ARM64#ARMv7#x86#UnlimitedDownloads

GitHub Trends

@githubtrending · Post #15431 · 23.01.2026 г., 13:30

#cplusplus#3d_engine#arm64#cmake#cplusplus#cpp17#d3d11#directx#directx11#engine#game#game_engine#gamedev#mod#opengl#opensource#sdl#sdl2#stalker#x64#xray_engine OpenXRay is a free, improved version of the X-Ray Engine for S.T.A.L.K.E.R. games like Call of Pripyat and Clear Sky. It adds 64-bit support, higher FPS, bug fixes, modding tools, and runs on Linux, macOS, and more. This benefits you with smoother, more stable gameplay, better performance on modern or non-Windows PCs, and easy access to new mods without changing the classic feel. https://github.com/OpenXRay/xray-16

GitHub Trends

@githubtrending · Post #15612 · 12.04.2026 г., 11:30

#c_lang#aarch64#arm#arm64#bios#boot_loader#boot_manager#bootloader#efi#gpt#loongarch#loongarch64#loongson#mbr#risc_v#riscv#riscv64#uefi#x64#x86#x86_64 Limine is a modern bootloader that boots Linux and other OSes on x86, ARM64, RISC-V, and LoongArch64 hardware, supporting MBR/GPT partitions and FAT/ISO filesystems on 32-bit Pentium Pro+ or 64-bit systems. Get binaries via Git (e.g., `git clone --branch=v11.x-binary`), build tools with `make`, and join Matrix/Fluxer chats for help. This lets you easily manage and boot multiple OSes with a clean menu, saving time on custom PC or server setups. https://github.com/Limine-Bootloader/Limine