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

Резултати

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

Пребарај: #snx

当前筛选 #snx清除筛选
Coin Sonar

@CoinSonar · Post #243517 · 17.04.2026 г., 07:49

#SNX | Volume spike (USDT PAIR) 67 times the average volume 107.06K USDT traded in 5 min └Selling vol: 69.96K USDT 🔴 Boost score: 1/10 24h Vol: 457.26K USDT (Binance) Price: 0.307 (-2.0% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28350 · 20.12.2024 г., 08:39

#SNX/USDT analysis : #SNX is currently retracing towards the support zone following a recent impulsive move. It is anticipated that after a breakout from this zone, the price will retest and subsequently bounce back, resuming its bullish momentum. TF : 1D Entry : $2.0 Target : $3.4 SL : $1.5

Hashtags

Pro Analysis

@proanalysistrader · Post #27938 · 16.09.2024 г., 14:02

#SNX/USDT analysis : #SNX has broken and retested the support zone, and it is currently facing resistance from the 200 EMA. The price is likely to continue its bearish momentum from its current level and retest previous lows. TF : 4H Entry : $1.353 Target : $1.229 SL : $1.430

Hashtags

American Crypto©

@americancryptotrading · Post #27461 · 06.12.2025 г., 10:17

🇺🇸#SNX/USDT is consolidating near the lowerborder of the descendingchannel on the weekly chart👀 Time to go long🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27429 · 05.11.2025 г., 09:26

🇺🇸#SNX/USDT is currently shaping the descendingchannel on the weekly timeframe💁‍♂️ Recovery is on the way✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27251 · 16.05.2025 г., 10:54

🇺🇸#SNX/USDT is about to break through the descendingchannel pattern on the daily timeframe🧐 Breakout is on the way🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27152 · 12.02.2025 г., 16:43

🇺🇸#SNX/USDT is facing the lowerborder of the falling wedge pattern on the weekly chart💁‍♂️ Looking for a rise📈 American Crypto©

Hashtags

Coinlegs Cryptocurrency Signals

@coinlegs · Post #9430 · 27.11.2023 г., 08:43

#SNX🐻👀 A little bit risky but will worth to try. Use SL. Want to see more strategies for any coin? Check out CoinLegs in order to have an overview before your trades 📊

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2992 · 09.11.2025 г., 07:01

UNBELIEVABLE PROFIT OF 23,600% HAS BEEN REALIZED IN #SNX 🔀 We're made a massive 2️⃣3️⃣6️⃣🔤 profit this Trade 🤑🔥 If you had only $50 inthis single position you would've made $11,800⭐ Went from 7,910% to 23,615%—That’s an extra 15,705% profit just by holding for maximum gains🥂🔥 If you're someone who's been following our progress, but haven't yet joined the PREMIUM group, what's holding you back? You can see the consistent profits we're making on a regular basis. The only difference between you and the members who send us the positive feedback you see, is that they took action and joined the PREMIUM group. It's business as usual - every day, like clockwork, we are in the fast lane, leaving the competition eating our dust 😮‍💨🪙 If you are ready to step up, send me a message and let's get started 👇 @Kevindexter✅

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2776 · 02.09.2025 г., 12:21

🔀#SNX/USDT 2,170% profit, insane move! 🤯 That’s 2️⃣1️⃣🔤 gain on your money 💰🔥 💰$50 would return $3600💸 💰$50 would return $1,085💎 💰$50 would return $1,085💎 Fast & solid results—that’s what we love the most. Any guesses on who’s missing out again? 🤔 Enjoy 2,170% profit🆙. 🤝Congratulations all Premium Members. Now imagine if you followed the rest of the signals.. 🤑💯 chat to join ➡️@Kevindexter✅️

Hashtags

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