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

Резултати

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

Пребарај: #bitfinex

当前筛选 #bitfinex清除筛选
Onchain Lens Channel

@OnchainLens · Post #5828 · 13.03.2026 г., 12:58

A whale has sold 2,311 $XAUT ($11.7M) for 5,313 $ETH ($11.33M) after holding it for 2 week via #Bitfinex. Address - 0xCE7E803F992106eCEbd9e833cE74c445EF2BdD42 https://x.com/OnchainLens/status/2032440990653661284 Follow @onchainlens for more onchain updates

Hashtags

Onchain Lens Channel

@OnchainLens · Post #5802 · 11.03.2026 г., 10:24

A freshly made wallet withdraw 738.38 $XAUT worth $3.8M from #Bitfinex https://intel.arkm.com/explorer/address/0xa64c560C37B9168183cB658d74d7d6c0a88FDEEc https://x.com/OnchainLens/status/2031677360941183247 Follow @onchainlens for more onchain updates

Hashtags

Onchain Lens Channel

@OnchainLens · Post #5592 · 23.02.2026 г., 08:55

A newly created wallet withdrew 500 $BTC worth $32.81M from #Bitfinex https://intel.arkm.com/explorer/address/bc1pkldc3d64ceqshhznxuj78r6e0a3p7gtdrrue07zmcq54xzlyuu9sppvxk0 https://x.com/OnchainLens/status/2025856881571557827 Follow @onchainlens for more onchain updates

Hashtags

Onchain Lens Channel

@OnchainLens · Post #5152 · 25.01.2026 г., 15:01

A newly created wallet received 25,001 $ETH worth $73.39M from #Bitfinex https://intel.arkm.com/explorer/address/0xa4eb173747e8C8252B6Ba56cE64C6D7631A36202 https://x.com/OnchainLens/status/2015439638102708547 Follow @onchainlens for more onchain updates

Hashtags

Onchain Lens Channel

@OnchainLens · Post #4854 · 02.01.2026 г., 09:24

In the past 24 hours, a whale withdrew 800 $BTC, worth $70.9M, from #Bitfinex. Currently, the whale holds 1,000 $BTC, worth $89.04M, accumulated over the past 6 days. Address: bc1pckv9jvpnwgw67p02jfuxxcr0ycmlyk5xaj7atwsfu08u87t5srvqannw34 https://x.com/OnchainLens/status/2007020103993524510 Follow @onchainlens for more onchain updates

Hashtags

Криптач

@kripota4 · Post #2637 · 07.10.2025 г., 15:38

Гигантский кит «0x67f» около 3 часов назад внес еще 15 000 $ETH (70,15 млн $) на #Bitfinex. За последние 2 дня кит вывел 30 000 $ETH (138,4 млн $) на биржу по средней цене 4 612 $ и перевел 23 278 $ETH (109,3 млн $) в 2 новых кошелька. Текущие активы: 70 785 $ETH (332,4 млн $) на 4 кошельках.

Hashtags

SpotOnChain | Announcement

@spotonchain · Post #1300 · 07.10.2025 г., 11:15

The giant whale “0x67f” above deposited another 15,000 $ETH ($70.15M) into #Bitfinex ~3 hours ago. Over the past 2 days, the whale has offloaded 30,000 $ETH ($138.4M) into the exchange at an average price of $4,612 and moved 23,278 $ETH ($109.3M) into 2 new wallets. Current holding: 70,785 $ETH ($332.4M) across 4 wallets. Watch out for more offloading activities from this giant whale with @spotonchain now! https://x.com/spotonchain/status/1975519812060426616

Hashtags

SpotOnChain | Announcement

@spotonchain · Post #937 · 02.08.2024 г., 02:03

Fresh whale “bc1qh” withdrew 4,600 $BTC ($291M) from #Bitfinex at the dip in the past 8 hours! Recently, we also noticed 3 other whales (likely one entity) withdrawing 3,910 $BTC ($257M) from #Bitfinex since June 12, with the last accumulation only 3 days ago. Is some institution trying to accumulate $BTC? 🚀 Follow @spotonchain and set alerts for the 4 whales via this entity: https://platform.spotonchain.ai/en/entity/2234

Hashtags

123•••910
ПретходнаСтраница 1 од 10Следна