Functional Programming in Python: Immutable Data Structures

Pubblicato il: 30 agosto 2017
sul canale di: Real Python
73,692
1.3k

https://dbader.org/python-tricks ► Leverage Python's advanced features to improve the quality of your code

In this Python tutorial you'll learn the basics of functional programming in Python and how you can use immutable data structures to represent data in your programs.

First, we'll go over what functional programming (FP) is from a computer science perspective and how it compares to other programming paradigms, like object-oriented programming (OOP), or procedural programming.

You'll learn how a functional programming style avoids side-effects and changing state in your programs by focusing on the application of mathematical functions as its core primitive.

Next, we'll take a simple data set and represent it inside our example program using immutable data structures (tuples and namedtuples from the "collections" module built into Python). Immutable data structures cannot be modified in-place and this can help reduce bugs.

This is part of a series of Python functional programming tutorials that I'm recording so stay tuned for the next instalment.

Also, be sure to check out these associated articles if you want to dive deeper into the subject:

https://dbader.org/blog/writing-clean...
https://dbader.org/blog/records-struc...


FREE COURSE – "5 Thoughts on Mastering Python" https://dbader.org/python-mastery

SUBSCRIBE TO THIS CHANNEL: https://dbader.org/youtube

* *

► Python Developer MUGS, T-SHIRTS & MORE: https://nerdlettering.com

► PythonistaCafe – A peer-to-peer learning community for Python developers: https://www.pythonistacafe.com

FREE Python Coding Tutorials & News:
» Python Tutorials: https://dbader.org
» Python News on Twitter:   / @dbader_org  
» Weekly Tips for Pythonistas: https://dbader.org/newsletter
» Subscribe to this channel: https://dbader.org/youtube


In questa pagina del sito puoi guardare il video online Functional Programming in Python: Immutable Data Structures della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Real Python 30 agosto 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 73,692 volte e gli è piaciuto 1.3 mille spettatori. Buona visione!