Welcome to Leonidas Constantinou
Latest blog posts
Are You Making These Critical Mistakes with Python Singletons?
Singletons are a classic design pattern used to ensure a class has only one instance and provides a global point of access to it. In Python, there are several ways to implement a singleton, each with its own trade-offs. This post walks through the most common approaches, their pitfalls, and best practices for robust singleton design.
Understanding Python Mixins: What they are, what they aren't, and why you should use them
Learn how Python mixins solve code reuse challenges without the complexity of deep inheritance hierarchies. Discover when to use mixins vs static classes, best practices for stateless design, and real-world examples that make mixins click.
From Chaos to Control: Mastering LLM Outputs with LangChain & Pydantic
This practical guide shows developers how to implement type safety and automatic validation, turning unpredictable language model responses into production-ready Python objects.
Evolving beyond simple chatbots: Leveraging RAG systems for more effective Q&A
Learn how to leverage this technology to create intelligent chatbots and support systems that understand and respond using your organisation's knowledge.
Kaggle's winning solutions for Melanoma Detection - Part1
Discover the techniques that allowed the Kaggle Grandmasters to win this competition
How to flatten a python list/array and which one should you use
A comprehensive review of various methods to flatten arrays and how to benchmark them