@Premier · Post #13076 · 22.03.2026 г., 17:53
⚽️ Man City scores! 64' Nico O’Reilly Arsenal ⚽️ 0 - 2 ⚽️ Man City 🏴🏴🏴🏴🏴#EFL
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
Пребарај: #efl
@Premier · Post #13076 · 22.03.2026 г., 17:53
⚽️ Man City scores! 64' Nico O’Reilly Arsenal ⚽️ 0 - 2 ⚽️ Man City 🏴🏴🏴🏴🏴#EFL
Hashtags
@Premier · Post #13075 · 22.03.2026 г., 17:51
⚽️ Man City scores! 60' Nico O’Reilly Arsenal ⚽️ 0 - 1 ⚽️ Man City 🏴🏴🏴🏴🏴#EFL
Hashtags
@english_bbc_learning · Post #3722 · 13.10.2025 г., 18:23
🤢😔 Everybody gets sick from time to time… so we made a vocabulary table with useful sickness-related English for you to learn, use, and share with a friend! 😄 Do you know any more English vocabulary related to illness? 👇 #englishvocabulary#learnenglish#englishphrases#britishenglish#EFL#ESL#ELT#vocab#bbclearningenglish
@english_bbc_learning · Post #3821 · 23.12.2025 г., 13:20
What you do is more important than what you say, right? 👍 Can you complete this English expression that means exactly that? Write your answer in the comments and don’t forget to give this post a like! Do you have a similar expression in your language? 👇👇👇 Want to learn more English expressions and idioms? Click the link in our bio to listen to our podcast The English We Speak! Image: Getty #learnenglish#esl#efl#vocabulary#englishclass#phrases#expressions#idiom#learnenglish#britishenglish#informalenglish#slang
@fluencyinenglish · Post #7902 · 06.10.2025 г., 08:29
💡 چرا پیشرَوی خطی تم (Linear Thematic Progression) در آیلتس کاربرد خوبی دارد؟ 🔹 ۱. ایدهها را بهصورت منطقی به هم وصل میکند در این نوع پیشروی، هر جمله ادامهی طبیعی جملهی قبلی است. در نتیجه، examiner احساس نمیکند ایدهها از هم جدا هستند. ✳️ متن مثل زنجیری منسجم و روان جلو میرود. 🔹 ۲. انسجام (Coherence & Cohesion) را بالا میبرد در معیار نمرهدهی آیلتس، انسجام نقش کلیدی دارد. اگر از پیشروی خطی استفاده کنی، ارتباط بین ایدهها کاملاً روشن میشود. ✅ همین باعث نمرهی بالاتر در این معیار میشود. 🔹 ۳. جریان فکری نویسنده واضح است وقتی هر جمله از اطلاعات جملهی قبلی ساخته شود، examiner دقیقاً مسیر استدلالت را میفهمد. در نتیجه، متن علمیتر و حرفهایتر به نظر میرسد. 🔹 ۴. برای گسترش یک ایده عالی است اگر میخواهی یک مفهوم را مرحلهبهمرحله توضیح دهی (مثلاً علت → نتیجه → پیامد)، این نوع پیشروی بهترین انتخاب است. 📘 مثال: > Online education gives students flexibility. This flexibility helps them manage time effectively. Better time management reduces stress and improves performance. 🟢 نتیجه: متن منسجم، طبیعی، و قابلدرک است, دقیقاً همان چیزی که examiner برای Band 9 میخواهد. #IELTSWriting#Cohesion#Coherence#IELTSBand9#AcademicWriting#LinearProgression#WritingTips#IELTSIran#EFL#TEFL#IELTSTeacher
@english_bbc_learning · Post #3720 · 10.10.2025 г., 15:34
😃Even if nobody in your family is called Bob, you can still use this informal English expression to say that a task is really simple and easy! Write your answer in the comments and be sure to like this post! Do you have a similar expression in your language? 👇👇👇 🤩 MORE: Learn about the stories behind our names with this episode of ⏱️ 6 Minute English. Click the link in our bio NOW! #idioms#esl#efl#vocabulary#englishclass#phrases#expressions#idiom#learnenglish#britishenglish#informalenglish#slang
@english_bbc_learning · Post #3724 · 17.10.2025 г., 12:23
🤩 Even if you don’t eat meat, you can still use this expression to say that you’re super-hungry! 😁 Write your answer in the comments and like and share this post! Do you have a similar expression in your language? 👇👇🤩 MORE: ⁉️Are you angry when you're hungry? There's an English expression for that! 😲 Click the link in our bio to find out what it is with ⏱️ 6 Minute English! Images: Getty #learnenglish#hungry#starving#horse#esl#efl#vocabulary#englishclass#phrases#expressions#idiom#learnenglish#britishenglish#informalenglish#slang
@english_bbc_learning · Post #3658 · 15.07.2025 г., 18:29
🤔 Did something bad happen to you when you weren’t expecting it? You’re not going to put yourself in that situation again, are you? 😄 Learn this useful English expression that summarises this life lesson. Give this post a like, and ✍️ put your answer in the comments! Do you have a similar expression in your language? 🤩 Click on the link in our bio to learn some modern idioms! Images: Getty #learnenglish#advice#idioms#esl#efl#vocabulary#englishclass#phrases#expressions#oncebitten#britishenglish#lifelesson#inspiration#slang
@english_bbc_learning · Post #3689 · 07.09.2025 г., 03:15
❓❓❓Do you know how to respond when an English speaker asks ‘Is the post office open today?’ 🏣Try this quiz - we’ll tell you the answer later! Are there any other ways you could respond?👇👇👇 [Image: Getty] #learnenglish#socialenglish#correctresponse#englishquiz#english#englishvocabulary#learnenglish#englishphrases#contraction#question#shortanswer#britishenglish#EFL#ESL#ELT#vocab#bbclearningenglish