@googlefactss · Post #39892 · 30.09.2025 г., 03:09
In January 2013 an erotic film was mistakenly aired for several minutes in the background during a national TV news report in Sweden. @googlefactss#bizarre
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
Пребарај: #bizarre
@googlefactss · Post #39892 · 30.09.2025 г., 03:09
In January 2013 an erotic film was mistakenly aired for several minutes in the background during a national TV news report in Sweden. @googlefactss#bizarre
Hashtags
@AiGenLabsStyles · Post #706 · 07.09.2024 г., 07:12
⭐️ --sref 1964343293 --s 250 #Photography#Surreal#Vibrant#Bizarre#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #726 · 10.09.2024 г., 09:14
⭐️ --sref 3414219761 #illustration#Bizarre#Dark#2d#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@googlefactss · Post #40837 · 21.03.2026 г., 05:57
There's an animal that smells like buttered popcorn. The binturong (Arctictis binturong), a Southeast Asian "bearcat," smells like buttered popcorn due to 2-acetyl-1-pyrroline (2-AP) in its urine, which it uses to mark territory. This chemical is the same aromatic compound produced when popcorn is popped. These arboreal, cat-like mammals are threatened by habitat loss. @googlefactss#animals#mammals#bizarre [read more....]
@AiGenLabsStyles · Post #815 · 27.09.2024 г., 13:28
⭐️ --sref 905263956 #illustration#2d#Dark#Bizarre#Cartoon#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #689 · 05.09.2024 г., 13:18
⭐️ --sref 2627355792 #illustration#2D#Vibrant#Bizarre#Cartoon#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #660 · 03.09.2024 г., 09:14
⭐️ --sref 3846026342 #illustration#Bizarre#Pastel#2d#Surreal#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #763 · 16.09.2024 г., 08:13
⭐️ --sref 4136665817 #illustration#2d#Cartoon#Vibrant#Dark#Bizarre#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #738 · 11.09.2024 г., 13:18
⭐️ --sref 2353362577 --s 888 #Cinematic#Surreal#Vibrant#Bizarre#Dark#Fantasy#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #676 · 04.09.2024 г., 13:18
🔝🔝 --sref 72314753 #illustration#3D#Vibrant#LowPoly#Bizarre#Cartoon#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel