On the brush, and on the bottle!
This image, from the collections at MAD Paris (https://madparis.fr), brought to mind the vintage Messy Nessy Chic piece about France’s ‘Santé Sobriété’ (health, sobriety) campaign in the 1950s.
On the brush, and on the bottle!
This image, from the collections at MAD Paris (https://madparis.fr), brought to mind the vintage Messy Nessy Chic piece about France’s ‘Santé Sobriété’ (health, sobriety) campaign in the 1950s.
Attributes vs Decorators: Metadata Systems Battle
PHP 8 attributes vs JavaScript decorators (proposed). Which language's metadata system is more powerful? This will make you rethink everything!
#php #javascript #phpvsjavascript #attributes #decorators #metadata #php8 #annotations #programmingcomparison #codecomparison #frameworkfeatures #viralcoding

Acabei de publicar um texto novo no Bolha sobre decorators em Python: em vez de tratar decorator como “mágica”, eu mostro passo a passo o que acontece quando você escreve @meu_decorator em cima de uma função, como o Python avalia isso internamente e como isso vira só uma atribuição de função em tempo de definição.
Além de destrinchar o funcionamento interno, o artigo mostra como criar seus próprios decorators do zero, primeiro na forma “manual” (sem sintaxe de @), depois evoluindo para exemplos práticos como log, medição de tempo de execução e validação de argumentos.
Se você quer entender de verdade o que está acontecendo por baixo do capô quando usa decorators — e parar de só copiar exemplo de Stack Overflow — vale dar uma lida:
https://bolha.blog/riverfount/decorators-internamente-como-funcionam-e-como-criar-os-seus
Decorators are optional, and privacy in Python is mostly convention.
Attributes vs Decorators: Metadata Magic Showdown
PHP 8 attributes vs Python decorators. Which language's metadata system is more powerful? This will make you rethink everything!
#php #python #phpvspython #attributes #decorators #metadata #php8 #annotations #programmingcomparison #codecomparison #frameworkfeatures #viralcoding

Decorators vs Higher-Order Functions: Function Enhancement Battle
Python decorators vs JavaScript higher-order functions. Which approach to function enhancement is more elegant? Mind-blowing comparison!
#python #javascript #pythonvsjavascript #decorators #higherorderfunctions #functioncomposition #programmingcomparison #codecomparison #pythontricks #javascripttricks #functionalprogramming #viralcoding

Python Advanced Function Decorators With Arguments
Learn advanced Advanced Function Decorators With Arguments techniques in Python
Master powerful patterns and best practices
Boost your Python programming skills
#python #programming #tutorial #coding #advanced #function #decorators

What is a decorator in Python?
A decorator is a function that takes another function, adds some extra behavior, and returns a new function. You use it when you want to add common logic, like logging, timing, authentication or validation, without changing the original function code.
#pythoninterview #pythondecorator #pythonjobprep #pythoncodinginterview #pythonpeak #pythonquestions #juniorpython #pythonconcepts #decorators #pythonprogramming
Every so often I get an email notification from some starred bug report about TC39 decorators, and I peek at what's going on, and it seems like the current situation is that it's fully standardized but all 3 browsers went "This is complicated and we don't feel like implementing it" 😞
I got less traffic for my Python article than I expected, so I added "Python" to the title, and inserted some section headers to break things up a bit, and make the flow of my thinking a bit clearer.
I was pretty happy with how this project turned out. This decorator makes the re.sub function simpler to work with. The decorator simplifies the re.sub API, wrapping your own function that takes in strings and returns a string. https://medium.com/@ptmcg/re-sub-as-a-decorator-madness-717eea7ded50 #python #decorators #regularexpressions