Game Instructions

Tap a tile to toggle its color. When a tile changes nearby tiles may change as well. Each move affect multiple tiles. The target is to turn all tiles into yellow in the fewest steps possible.

Press 'j' to show/hide the game. Press 'i' to show/hide the instructions. Press 't' to show/hide the top score table.

Steps: 0

Top Scores

Name Steps
Press J to toggle the game, I to toggle instructions, and T to toggle the top scores

Congratulations!

You solved the puzzle in 0 steps!

Success!

Score submitted successfully!

Error

Failed to submit score. Please try again.

Exploring the Elegance of the Combinator Design Pattern at Python Summit 2026

Warsaw at Night
Python Summit 2026 brought together passionate developers for an inspiring event. I was thrilled to contribute with a talk about the Combinator Design Pattern.

I was truly excited to take part in Python Summit 2026, and to have the opportunity to deliver my talk, “The Combinator Pattern: Elegant Composition for Modern Python Developers.” Participating in conferences is always a wonderful experience for me. Beyond sharing knowledge, these events provide an opportunity to meet fellow developers, discover new perspectives, and connect with people who share the same passion for software development. Python Summit was no exception. It was a great experience, and I was delighted to contribute to the conference program with a topic that I particularly enjoy teaching: software design patterns.

Slides from My Talk

I’m happy to share the slides from my talk, “The Combinator Pattern: Elegant Composition for Modern Python Developers.” The presentation explores how the Combinator Design Pattern helps us build complex logic by composing small, independent, and reusable components. It also demonstrates how this approach supports the Single Responsibility and Open-Closed principles, resulting in cleaner, more flexible, and maintainable Python code. Whether you attended my talk or couldn’t make it, I hope you’ll find the slides useful and inspiring. Feel free to download, explore, and share them!

The Code Sample

Below is the code sample I used during my talk at Python Summit 2026. These examples demonstrate the practical application of the Combinator Design Pattern in Python, showing how independent, reusable logic units can be composed to create more complex behavior. They complement the presentation slides and provide an opportunity to explore the concepts in greater detail, experiment with the implementations, and apply the pattern in your own projects.

				
					from __future__ import annotations

from dataclasses import dataclass
from typing import Callable, List


@dataclass(frozen=True)
class ValidationResult:
    valid: bool
    errors: List[str]

    @staticmethod
    def success() -> ValidationResult:
        return ValidationResult(True, [])
    @staticmethod
    def failure(message: str) -> ValidationResult:
        return ValidationResult(False, [message])

    def merge(self, other: ValidationResult) -> ValidationResult:
        return ValidationResult(
            valid=self.valid and other.valid,
            errors=self.errors + other.errors,
        )



class PasswordRule:
    def __init__(self, validator: Callable[[str], ValidationResult]):
        self._validator = validator

    def validate(self, password: str) -> ValidationResult:
        return self._validator(password)

    def __call__(self, password: str) -> ValidationResult:
        return self.validate(password)

    def and_(self, other: PasswordRule) -> PasswordRule:
        def combined(password: str) -> ValidationResult:
            return self.validate(password).merge(other.validate(password))
        return PasswordRule(combined)

    def or_(self, other: PasswordRule) -> PasswordRule:
        def at_least_one(password: str) -> ValidationResult:
            result = self.validate(password).valid or other.validate(password).valid
            return ValidationResult.success() if result else ValidationResult.failure("Password must match at least one rule.")
        return PasswordRule(at_least_one)



def min_length(length: int) -> PasswordRule:
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if len(password) >= length
            else ValidationResult.failure(
                f"Password must be at least {length} characters long."
            )
        )
    )


def has_uppercase() -> PasswordRule:
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if any(ch.isupper() for ch in password)
            else ValidationResult.failure(
                "Password must contain at least one uppercase letter."
            )
        )
    )


def has_lowercase() -> PasswordRule:
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if any(ch.islower() for ch in password)
            else ValidationResult.failure(
                "Password must contain at least one lowercase letter."
            )
        )
    )


def has_digit() -> PasswordRule:
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if any(ch.isdigit() for ch in password)
            else ValidationResult.failure(
                "Password must contain at least one digit."
            )
        )
    )


def has_special_char() -> PasswordRule:
    special_chars = set("!@#$%^&*()-_=+[]{};:,.<>?/|\\")
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if any(ch in special_chars for ch in password)
            else ValidationResult.failure(
                "Password must contain at least one special character."
            )
        )
    )


def no_whitespace() -> PasswordRule:
    return PasswordRule(
        lambda password: (
            ValidationResult.success()
            if not any(ch.isspace() for ch in password)
            else ValidationResult.failure(
                "Password must not contain whitespace."
            )
        )
    )


if __name__ == "__main__":
    password_policy = (
        min_length(8)
        .and_(has_uppercase())
        .and_(has_lowercase())
        .and_(has_digit())
        .and_(has_special_char())
        .and_(no_whitespace())
    )

    passwords = [
        "abc",
        "password123",
        "Password123",
        "Password123!",
        "Password 123!",
    ]

    for password in passwords:
        result = password_policy.validate(password)

        print(f"Checking password: {password!r}")
        if result.valid:
            print("  Valid password")
        else:
            print("  Invalid password")
            for error in result.errors:
                print(f"   - {error}")
        print()

    #password = "abC"
    #policy = min_length(8).or_(has_uppercase())
    #print(policy.validate(password).valid)
				
			

Thanks to the Organizers

I would like to express my sincere appreciation to the organizers of Python Summit 2026 for the excellent organization and for creating such a welcoming environment for speakers and attendees. A special thank you for accepting my proposal and giving me the opportunity to deliver a talk about the Combinator Design Pattern. Organizing a conference requires considerable effort, dedication, and attention to detail. As someone who also organizes developer conferences, I particularly appreciate the hard work that goes into making these events possible. Thank you for a wonderful experience!

I would also like to thank everyone who attended my session. I hope the talk provided useful insights and inspired you to explore the Combinator Design Pattern in your own Python projects.

For me, software development has always been about continuous learning, sharing knowledge, and finding better ways to solve problems. Python Summit 2026 in Warsaw was another wonderful opportunity to do exactly that. I look forward to meeting the Python community again at future conferences!

Share:

Sofia Bulgaria

Sharing My Experience at WordCamp Sofia 2026

Sharing highlights from my talk at WordCamp Sofia 2026, exploring practical WordPress hardening techniques, stronger authentication, and the importance of layered security beyond WAF protection.

online conference

Sharing My Experience at All Day AI 2026

It was an inspiring day of discussions about AI, excellent organization, and engaging conversations on discord. It was a great opportunity for sharing my perspective about Spec-Driven Development.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences