Category: Python Tips
-
Python contextlib: contextmanager and ExitStack Deep Dive
Stop writing repetitive try-finally blocks. Python's @contextmanager and ExitStack manage resources in 3 linesโbenchmarks and gotchas included.
-
dataclasses vs Pydantic vs attrs: Python Data Model Guide
dataclasses vs Pydantic vs attrs: real benchmarks, validation tradeoffs, and which to pick for production. Spoiler: speed isn't the deciding factor.
-
Python Memory Profiling: tracemalloc and memray in Prod
Debugged a 47GB memory leak in production using tracemalloc and memray. The exact profiling workflow I use to find Python leaks in under an hour.
-
Python Design Patterns: Strategy, Observer, and Factory
Ditch Java-style classes. Implement Strategy, Observer, and Factory patterns using Python's first-class functions and decorators โ 50% less code.
-
Polars vs Pandas ์ฑ๋ฅ ๋น๊ต: ๋์ฉ๋ ๋ฐ์ดํฐ ์ฒ๋ฆฌ ์๋๊ฐ 10๋ฐฐ ๋น ๋ฅธ ์ด์ ์ ๋ง์ด๊ทธ๋ ์ด์ ์ค์ ๊ฐ์ด๋
Polars processed 10GB CSV in 8 seconds vs Pandas' 94 seconds. Lazy evaluation and parallel execution explained with migration code examples.
-
Python์ผ๋ก ์์ํ๋ ํ๋ก๊ทธ๋๋ฐ: ์ด๋ณด์๋ฅผ ์ํ ์๋ฒฝ ๊ฐ์ด๋
Python basics to production skills: syntax, data structures, and real automation workflows for data analysis, web scraping, and scripting.
-
Advanced Python Decorators: Classes, Stacking, Production
Class decorators with ParamSpec typing fix Flask middleware bugs most devs miss. Stacking order secrets + descriptor protocol patterns inside.
-
Custom Python Decorators: Args, Returns, and Patterns
Build retry decorators that handle async, preserve signatures, and avoid the *args trap. Real memoization patterns with ParamSpec typing.