Giordani L. First-class objects in Python...2022

Download Download Torrent Opens in your torrent client (e.g. qBittorrent)
Category Other
Size0.01 kB
Added1 year ago (2025-03-10 23:38:19)
Health
Dead0/0
Info Hash9EC86445313809EBEB04EDB44702530739774C32
Peers Updated17 hours ago (2026-03-29 01:56:06)

Report Torrent

0 / 300

Description


Textbook in PDF format

This short book will tell you all you need to know to understand first-class citizenship in Python, which is the gateway to grasp how decorators work and how functional programming can supercharge your code.
The book contains three simple lessons, "First-class functions", "Nested functions", and "Factories", each one with some exercises and solutions. It also contains a section on "Functions and objects" and "Higher-order objects" where I discuss in detail how the concepts learned in the three lessons apply to classes and instances.
One of the most important concepts that you can find in Python (as in other languages like JavaScript, Ruby, and Scala, just to name some of the most important ones) is that of first-class citizenship. In this book I will discuss what first-class means and how knowing such a concept can benefit your code.
The starting point is a very simple question. We know that we can assign values to variables and pass values to functions. But are functions valid “values” as well? Can we use them as we use integers or lists?
The answer is yes, and this feature is granted by the first-class citizenship of functions, or, if you prefer, by high-order functions. Languages that implement such a concept offer an amazing level of power to the programmer, and in this book I will explain it through simple examples and exercises

×