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

Резултати

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

Пребарај: #sfp

当前筛选 #sfp清除筛选
Pro Analysis

@proanalysistrader · Post #28218 · 17.11.2024 г., 11:45

#SFP/USDT analysis : #SFP has broken down and retested the previous support zone, which is now acting as resistance. The price is expected to retest this zone and continue to decline further, potentially testing lower levels. TF : 2H Entry : $0.6775 Target : $0.6232 SL : $0.7041

Hashtags

Pro Analysis

@proanalysistrader · Post #28063 · 25.10.2024 г., 06:39

#SFP/USDT analysis : #SFP is in a downtrend, consistently making lower lows (LLs) and lower highs (LHs) below the 200 EMA. The price is currently facing rejection at the 200 EMA and is expected to decline further, potentially testing lower levels. TF : 4H Entry : $0.7145 Target : $0.6718 SL : $0.7409

Hashtags

American Crypto©

@americancryptotrading · Post #27100 · 28.12.2024 г., 13:56

🇺🇸#SFP/USDT is trading above the symmetricaltriangle pattern on the weekly chart🧐 Send it📈 American Crypto©

Hashtags

Crypto Angels

@cryptoangelsusa · Post #21899 · 02.11.2025 г., 15:05

Binance Futures, Bitget Futures, ByBit USDT, KuCoin Futures, OKX Futures #SFP/USDT Take-Profit target 2 ✅ Profit: 29.9145% 📈 Period: 1 Days 3 Hours 44 Minutes ⏰

Hashtags

Alphavave Traders ️️️

@alphavave · Post #3181 · 28.02.2026 г., 03:56

🔒#SFPdelivered a mind-blowing 3,140% profit within 6 days! 🤯 That’s 3️⃣1️⃣🔤 return on your money 💰 💼 $50💰 would return $100💵 $50 💰 would return $585 💲 $50💰 would return $1,570💰 If you used 75x for this signal via Binance, that's a incredible1,175% profit at the 1️⃣ 🔠 🔠target point💰 That's about as good as it gets! With over 5 years of trading experience, we see these moves comingand there’s more on the way-don’t miss out on the next big wins! 🚀🚀 Want to stay ahead of the game? Take action now and change your life💯 ⚡️LAST SPOT AVAILABLE AT 60% OFF!⚡️ ✅Monthly access is now just $70 (originally $200) ✅6-Month access is now just $180 (originally $500) ✅Lifetime access is now just $500 💵 (originally $1250) t.me/Kevindexter

Hashtags

Crypto

@signal_bitcoins · Post #2478 · 23.01.2024 г., 10:31

🔐#SFP has a bullish channel on 12H Time frame, we expect a good pump until the ceiling of this pattern if price saved the bottom..👀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

ПретходнаСтраница 1 од 3Следна