Skip to main content

39 posts tagged with "python"

View All Tags

What is Mypy, How to Use It, and Why It Matters

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Python is known for being a dynamically typed language — you don’t have to declare variable types, and everything works at runtime. But as your codebase grows, undetected type errors can creep in. That’s where Mypy comes in.

Mypy is a static type checker for Python. It checks your Python code for type errors without running it.

What is Shift Left Paradigm in Programming? Explained for Beginners

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

If you've heard developers or tech leads talk about "shifting left", it may sound like some kind of command-line trick. But in reality, "shift left" is a mindset — and it's becoming increasingly important in modern software development.

Whether you're writing Python or any other language, understanding this approach can help you build more reliable code, find bugs earlier, and ship faster.

How to Measure Execution Time of a Function in Python (With Examples)

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Measuring how long your Python code takes to run is a critical skill for performance optimization, profiling, or benchmarking different approaches to solving a problem. Python offers many tools for tracking the execution time of a function — from simple built-in methods to full-blown profilers.

In this guide, we will explore multiple methods with code examples to help you choose the right one for your use case.

How to Stream Media Files from S3 Directly to AWS Lambda Using FFmpeg in Python

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Processing media files inside AWS Lambda can be a challenge due to its resource limits, lack of a local disk, and timeouts. However, it’s entirely possible to stream files directly from S3 into FFmpeg, process them on the fly, and avoid writing anything to disk.

In this guide, we’ll cover:

  • Streaming files from S3 into Lambda
  • Using ffmpeg with stdin and stdout in memory
  • Avoiding /tmp bottlenecks
  • Examples and production-ready patterns

Best Practices for Using msgspec in Python for High-Performance Serialization

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

msgspec is a high-performance serialization library designed for modern Python applications. It combines type-safe data modeling, blazing-fast parsing, and flexible support for multiple serialization formats, including MessagePack, JSON, and TOML.

This article outlines the best practices for integrating msgspec into your codebase. It provides a practical, performance-oriented guide to writing cleaner, safer, and faster Python services.

What is an Off-by-One Error in Python? (Explained for Kids!)

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Have you ever counted your toys and accidentally said you had 11, but really only had 10? That’s kind of what an off-by-one error is in Python!

It’s a tiny mistake where your program counts 1 too many or 1 too few. These mistakes are super common, even for professional programmers.

Drawbacks of Msgspec Compared to Pydantic: A Deep Dive with Examples

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

msgspec is gaining attention in the Python ecosystem due to its incredible speed and minimalist design. It's written in Rust, supports JSON and MsgPack, and uses type hints for validation. But like every tool, it’s not perfect — and when compared to the battle-tested and feature-rich Pydantic, there are several key trade-offs to be aware of.

In this article, we’ll explore what msgspec lacks compared to Pydantic, illustrated with code examples and practical reasoning.

Python Data Serialization in 2025 - Alternatives to Pydantic and the Future Landscape

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

As of 2025, Pydantic remains a cornerstone of data validation and serialization in the Python ecosystem. Yet, with the evolving needs of performance-critical applications and broader standardization efforts in the language, new contenders have emerged — and old ones are adapting.

In this article, we explore the current landscape of Python data serialization libraries, their strengths, weaknesses, and futures.

Best Practices for Using Pydantic with Flask for Request and Response Serialization

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Pydantic is widely known for its powerful data validation and parsing capabilities using Python type hints. While it's most popular with FastAPI, it can be elegantly integrated with Flask to improve request validation, input parsing, and response formatting.

This article outlines best practices for combining Flask with Pydantic in a clean, maintainable way.