/explore
|
You are here |
davidbieber.com | ||
| | | | |
jimpurbrick.com
[AI summary] The article discusses the use of Python decorators for handling web requests, their interaction with introspection, and methods to preserve function metadata while maintaining decorator visibility. |
|
| | | | | ||
| | | | |
aivarsk.com
I have a piece of C++ code that calls user-defined functions implemented in Python. Instead of requiring all functions to have the same signature with 6 arguments, the C++ code inspects the function signature and passes only the arguments function accepts - 1, 3, or all 6 of them. I use the inspect module and getargspec function for that but it feels a bit wrong and bloated. So let's see how we can get the work done without the inspect module. |
|
| | | | | ||
| | | | |
ykarroum.com
[AI summary] This technical article demonstrates how to create a Python decorator that automatically detects and sets the inplace=True parameter for pandas and numpy functions to optimize memory usage, while carefully handling reference counting and syntax tree analysis to prevent unintended side effects. |
|
| | | | | ||
| | | | |
aaronluna.dev
Decorators can be a daunting topic when first encountered. While the Zen of Python states "There should be one- and preferably only one -obvious way to do it", there are many, equally valid ways to implement the same decorator. These different methods can be categorized as either function-based, class-based, or a hybrid of both. In this post I will explain the design and behavior of Python decorators and provide examples of decorators that I frequently use in my own code. |
|
| | | |||