A python lambda expression ...

Can it be used as a decorator?

b = lambda func: lambda *args, **kwargs: (print("a"), func(*args, **kwargs), print("c"))

@b
def a():
    print("b")

Interesting

Recommended Posts

A python lambda expression ...
Use print in a Python2 lambda expression
Lambda expression
[Python] Make the function a lambda function
lambda expression memo
[Python 3.8 ~] How to define a recursive function smartly with a lambda expression
A * algorithm (Python edition)
[Python] Take a screenshot
Create a Python module
Daemonize a Python process
python regular expression memo
Create a Python environment
Regular expression in Python
Regular expression in Python
Python3> round (a --b, 7)
Make one repeating string with a Python regular expression.
Create a Layer for AWS Lambda Python with Docker
A python regular expression, or a memo of a match object
[Piyopiyokai # 1] Let's play with Lambda: Creating a Python script
AtCoder ABC 177 Python (A ~ E)
Take a screenshot in Python
Python> lambda> tiny functions / callback functions
Create a Wox plugin (Python)
Operate TwitterBot with Lambda, Python
Use let expression in Python
Create a function in Python
Create a dictionary in Python
[Python] Scraping in AWS Lambda
AtCoder ABC 178 Python (A ~ E)
A road to intermediate Python
[Python] Use a string sequence
Python 處 處 regular expression Notes
Query Athena from Lambda Python
AtCoder ABC 176 Python (A ~ E)
Python list is not a list
A memorandum about correlation [Python]
Make a bookmarklet in Python
Building a Python virtual environment
Create a python numpy array
Make a fortune with Python
I made a python text
A memorandum about Python mock
Regular expression manipulation with Python
AtCoder ABC 182 Python (A ~ D)
Build a Python environment offline
Draw a heart in Python
Create a directory with python
Building a Python virtual environment
[Python] Dynamic programming TDPC A
How to use Python lambda
What is a python map?
A note about [python] __debug__
Determine if a string is a time with a python regular expression
Quickly take a query string with API Gateway-> Lambda (Python)
AWS Amplify + API Gateway + Lambda + Python returns a normal response
AtCoder ABC168 A case expression solved in Ruby and Python
Building a Python environment on Mac
Python a + = b and a = a + b are different
[Python] What is a zip function?
Maybe in a python (original title: Maybe in Python)
[Python] What is a with statement?