1
0 Comments

Python's partial functions with the functools library

Python's functools.partial and partialmethod let you pre-fill arguments of existing functions or methods, reducing repetition and improving code readability. The post explains the difference between partial (for standalone functions) and partialmethod (for class methods, which must handle Python's descriptor protocol). Practical examples include reusing Django model fields across multiple models and wrapping subprocess calls in a CLI tool.

on June 7, 2026
Trending on Indie Hackers
Most founders don't have a product problem. They have a visibility problem User Avatar 106 comments Day 4: Why I Built a $199 Workspace Nobody Asked For User Avatar 55 comments Hi IH — quick update. The MVP is live. User Avatar 28 comments I Built a Football Sentiment Platform in 18 Days. The World Cup Starts in 7 Days. Now I Need Distribution. User Avatar 17 comments Built an n8n booking alert system — is cold outreach dead for B2B micro-tools? User Avatar 16 comments Day 7: 51 people answered my question. I wasn't ready for what they said. User Avatar 15 comments