@StickersChannel · Post #1134 · 17.04.2016 г., 23:50
🌍 Little Big Planet ↘️https://telegram.me/addstickers/littlebigplanetPM 🕶@stickersChat #Planet
Hashtags
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
Пребарај: #planet
@StickersChannel · Post #1134 · 17.04.2016 г., 23:50
🌍 Little Big Planet ↘️https://telegram.me/addstickers/littlebigplanetPM 🕶@stickersChat #Planet
Hashtags
@Isaiahsystem · Post #1092 · 21.12.2023 г., 11:42
1 小时了解地球整个历史(45 亿年) 4.5 Billion Years in 1 Hour Kurzgesagt 最近制作了关于地球整个历史的介绍动画,1 小时视频拉过地球 45 亿年历史,每秒闪过 100 万年。 动画制作精美,观感非常舒服,适合科普教育,如果像之前分享的 Short Trip 那样交互互动,就更棒了。Kurzgesagt 是个通过动画视频进行科普的油管频道,内容质量很不错。 Reference YouTube 的使用 Combo #planet
Hashtags
@bestwallpapes · Post #3798 · 18.12.2025 г., 05:24
@Bestwallpapes #Planet#Space
@wallpapersarena · Post #3108 · 15.08.2021 г., 14:06
#nature#planet @WallpapersArena
@wallparpes_hd · Post #206 · 21.03.2020 г., 23:54
Mars #planet#space 📱 Wallpapers full HD ⭐📱 https://t.me/joinchat/AAAAAE65rdIFyMNq1qiq7A
@AloneSnowflake · Post #614 · 31.10.2025 г., 21:31
⊹ 𝐀pply 𝐓heme ˓ 🪐 ˒ ༄ 𝐉oin 𝐂hannel ˙˚• #Planet#Dark#Blue#Theme
@interesting_planet_facts · Post #739 · 13.09.2025 г., 03:22
🌎 Earth’s “hum” is a persistent, faint vibration detectable even without earthquakes. Seismic sensors first recorded this low-frequency noise in 1998; it’s caused by ocean waves interacting with the seafloor. This global signal averages around 2 to 7 millihertz in frequency. ✨ #sound⚡#planet⚡#mystery 👉subscribe Interesting Planet
@amazingeo · Post #524 · 19.12.2025 г., 20:31
🌍 Earth's atmosphere extends far beyond clouds, but 99% of its mass is within just 32 kilometers of the surface—a thin layer compared to the planet's size, yet essential for life. ✨ #earth⚡#planet⚡#atmosphere⚡#geography⚡#nature 👉subscribe Amazing Geography 👉more Channels
@amazingeo · Post #148 · 31.08.2025 г., 03:12
🌍 Earth’s atmosphere is a fragile shell just 100 kilometers thick—less than 2% of the planet’s radius. This thin layer protects all life from harmful space radiation and extreme temperatures. ✨ #earth⚡#atmosphere⚡#planet⚡#geography⚡#nature 👉subscribe Amazing Geography🌍
@amazingeo · Post #261 · 18.09.2025 г., 20:12
🌍 Earth’s surface area is about 510 million square kilometers—more than 70% is covered by oceans, making our home a true water planet among the rocky worlds of our Solar System. ✨ #Earth⚡#oceans⚡#planet⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@AloneSnowflake · Post #427 · 03.10.2024 г., 21:31
⊹ 𝐀pply 𝐓heme ˓ 💜🧡 ˒ ༄ 𝐉oin 𝐂hannel ˙˚• #Planet#Dark#Purple#Orange#Theme
@ecumenopolis_megastructure · Post #2598 · 14.10.2025 г., 07:15
#space #planet #megastructure
Hashtags