Standard Search
About 149 results
https://rednafi.com/python/decorators/ · 13 May 2020
Complete guide to Python decorators from first principles. Learn closures, higher-order functions, decorator patterns, and advanced techniques.
https://rednafi.com/python/concurrent-futures/ · 21 Apr 2020
Master Python's concurrent.futures module for easy threading and multiprocessing. Learn ThreadPoolExecutor and ProcessPoolExecutor with examples.
https://rednafi.com/python/pathlib/ · 13 Apr 2020
Replace os.path with Python's pathlib for elegant, object-oriented path manipulation with intuitive operators and unified file operations.
https://rednafi.com/python/pre-commit/ · 6 Apr 2020
Automate Python code quality with pre-commit hooks running Black, isort, flake8, and mypy before each git commit for consistent formatting.
https://rednafi.com/python/singledispatch/ · 5 Apr 2020
Replace complex if-elif chains with functools.singledispatch for type-based function dispatch and cleaner polymorphic behavior in Python.
https://rednafi.com/python/contextmanager/ · 26 Mar 2020
Deep dive into Python context managers. Learn to write custom managers with __enter__/__exit__, use contextlib decorators, and manage resources elegantly.
https://rednafi.com/python/dataclasses/ · 12 Mar 2020
Master Python dataclasses to eliminate boilerplate code. Learn ordering, immutability, hashing, default values, and post-init processing.
https://cuducos.me/refactor-facil-em-python-com-neovim.html · 16 Feb 2019
Uma vez ouvi um amigo, o Henrique Bastos, falar pra alguém que usava Vim algo como: > Quero ver fazer um refactor tão fácil como no PyCharm… Por refactor ele queria dizer mudar o nome de um objeto (uma função, uma classe, um método) e a <acronyn ...
https://cuducos.me/tuplas-e-listas-no-python.html · 13 Jun 2018
Outro dia, em um fórum de Python, alguém perguntou: > Existe alguma diferença entre tupla e lista em relação a performance? Como alguns de vocês talvez já saibam, eu adoro olhar para o Python com um olhar crítico de performance. Então logo respo...
https://cuducos.me/geradores-do-python-o-que-sao-e-quais-problemas-resolvem.html · 11 Aug 2017
Outro dia um amigo viu eu escrevendo uma _função_ em Python que usava yield ao invés de return e perguntou: > — Qual a utilidade disso? Nunca entendi… Na verdade eu estava escrevendo um _gerador_ e não uma _função_. A sintaxe é basicamente a ...