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

Резултати

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

Пребарај: #zrousdt

当前筛选 #zrousdt清除筛选
GG-Shøt. Indicator & Signals

@doublegtrading · Post #7864 · 06.10.2025 г., 08:07

📩#ZROUSDT 30m | Mid-Term 📈Short Entry Zone: 2.2664-2.3691 🎯 - Strategy Accuracy: 92.26% Last 5 signals: 80.0% Last 10 signals: 85.0% Last 20 signals: 87.18% ⏳ - Signal details: Target 1: 2.2358 Target 2: 2.2052 Target 3: 2.1746 Target 4: 2.0828 _____ 🧲Trend-Line: 2.3691 ❌Stop-Loss: 2.4010 💡After reaching the first target you can put the rest of the position to breakeven

Hashtags

GG-Shøt. Indicator & Signals

@doublegtrading · Post #7697 · 23.07.2025 г., 09:42

📩#ZROUSDT 30m | Mid-Term 📈Short Entry Zone: 2.1676-2.3075 🎯 - Strategy Accuracy: 93.28% Last 5 signals: 87.5% Last 10 signals: 92.31% Last 20 signals: 86.96% ⏳ - Signal details: Target 1: 2.1264 Target 2: 2.0851 Target 3: 2.0439 Target 4: 1.9202 _____ 🧲Trend-Line: 2.3075 ❌Stop-Loss: 2.3514 💡After reaching the first target you can put the rest of the position to breakeven

Hashtags

Propheta Indicator Signals

@propheta_indicator · Post #23753 · 19.04.2026 г., 02:51

#ZROUSDT has achieved 9th TP in 8 hours in our VIP PRO channel! Using a 5% entry you could've earned $619 with a $1000 deposit ACCESS TO MANUAL TRADING for 70usdt/month 👉 We ain't just showing our results, we can show you the results of our VIP subscribers as well! Check them out: @propheta_reviews Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingindicator#trading#btc

Propheta Indicator Signals

@propheta_indicator · Post #23474 · 16.03.2026 г., 04:13

👆 Propheta living up to its name yet again 🔮 #ZROUSDT has achieved 9th TP in our VIP PRO channel! $608 in profits with a 5% entry and a $1000 deposit! Feels good to be a Propheta VIP, man... 🏖ACCESS TO MANUAL TRADING for 70usdt/month ⚡️Speed up your trading with Propheta AI Signals: real-time precision signals, elite-level automation, and Cornix integration — the future of trading is now! GET THE ACCESS TO AI SIGNALS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptoexchange#cryptocurrency#AItrader

Mexc Crypto Signals Pumps Trading Kucoin

@mexc_signals_pumps_trading · Post #2007 · 09.12.2025 г., 22:31

Coin: #ZROUSDT Direction: Long Leverage: 5-10x #ZRO has already broken out of the Falling Wedge pattern and is looking bullish. Entry: $1.4337 - $1.3600 (Buy partially) Targets: $1.4808 - $1.5200 - $1.5600 - $1.6000 - $1.7000 - $1.8000 (Short term) Stop-loss: $1.3000

Hashtags

Mexc Crypto Signals Pumps Trading Kucoin

@mexc_signals_pumps_trading · Post #1996 · 07.12.2025 г., 08:33

Coin: #ZROUSDT Direction: Long Leverage: 5-10x #ZRO has already broken out of the Falling Wedge pattern and is looking bullish. Entry: $1.4337 - $1.3600 (Buy partially) Targets: $1.4808 - $1.5200 - $1.5600 - $1.6000 - $1.7000 - $1.8000 (Short term) Stop-loss: $1.3000

Hashtags

Mexc Crypto Signals Pumps Trading Kucoin

@mexc_signals_pumps_trading · Post #1986 · 04.12.2025 г., 07:07

#ZROUSDT UPDATE: #ZRO is now currently trading around $1.4290. It has already broken out of the Falling Wedge pattern and is looking good. So if the price pumps from here, then we can see short-term bullish momentum in it according to the pattern. If the breakout is a fake out, then it may again trade inside the pattern. Keep an eye on it.

Hashtags

CryptoBull_360™

@cryptobull_360 · Post #48227 · 11.02.2026 г., 01:59

0⃣#ZRO + #Tether = 🚀🚀🚀 Tether recently invested in #LayerZero, and you know they don't drop cash without deep due diligence. 🕵️‍♂️ The fundamentals are rock solid. This rally is just the beginning. 🌤 I’m stacking as much $ZRO as possible. targeting 2x - 5x gains! 💸 Get in or get left behind.👋 #DeFi#BullRun $ZRO #ZROUSDT https://x.com/CryptoBull_360/status/2021403228970315928?s=20