14

An exploration of partial() and partialmethod() in functools

you are viewing a single comment's thread
view the rest of the comments
[-] Spott@lemmy.world 3 points 1 year ago

They are different though, and the article doesn’t go into why they are different, which I think is a major omission (though a common one in articles about this subject).

The difference is that lambda functions are late binding, while partial functions are bound when they are created. This can lead to all sorts of hard to find bugs when using lambdas that are avoided by using partials.

this post was submitted on 07 Jul 2023
14 points (100.0% liked)

Python

6174 readers
10 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

October 2023

November 2023

PastJuly 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS