@khazar_dictionary · Post #1104 · 19.09.2022 г., 18:45
India and Saudi Arabia have held discussions on the feasibility of institutionalising Rupee-Riyal trade, and introduction of UPI and Rupay cards in the kingdom. #dedollarization
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
Пребарај: #dedollarization
@khazar_dictionary · Post #1104 · 19.09.2022 г., 18:45
India and Saudi Arabia have held discussions on the feasibility of institutionalising Rupee-Riyal trade, and introduction of UPI and Rupay cards in the kingdom. #dedollarization
Hashtags
@badvolfnews · Post #1941 · 05.12.2024 г., 12:02
Hey guys, it’s John Mark Dugan. Here’s why Trump’s threat to impose 100% tariffs on BRICS countries over a new currency is doomed to fail: BRICS nations aren’t leaving the dollar out of spite—they’re doing it to survive US sanctions and blackmail. The dollar’s dominance has been weaponized for too long. Russia, China, India, Brazil, and others are moving toward their own reserve currency, and it’s a smart move. The US created this mess by abusing its power, and Trump can’t undo that damage with empty threats. The world is changing, and the days of US economic control are over. #BRICS#DeDollarization#Trump#USPolitics
@CryptoM · Post #65452 · 13.04.2026 г., 09:22
🚀 Bitcoin's Potential Valuation by 2050 Discussed by Strategist PANews posted on X (formerly Twitter) that strategist Mark Moss shared his insights on the future valuation of Bitcoin during a podcast. Moss projected that by 2050, Bitcoin could reach a value of $45 million. He further speculated that if Bitcoin were to replace the U.S. dollar as the global unit of account, its value might even soar to $500 million. Moss's predictions are based on several factors, including the anticipated growth of the global store of value basket, which he estimates will reach $80 trillion by 2050. He believes Bitcoin could potentially capture around 20% of this market share. Additionally, Moss highlighted the impact of a 50-year cycle of technological revolution and the geopolitical trend towards de-dollarization, suggesting that these elements could contribute to Bitcoin's significant valuation increase. #Bitcoin#Valuation #2050 #MarkMoss#FuturePrediction#Cryptocurrency#GlobalEconomy#StoreOfValue#DeDollarization#Geopolitics#TechnologicalRevolution#DigitalCurrency#BTC