René's URL Explorer Experiment


Title: Writing Clean, Pythonic Code With namedtuple (Summary) (Video) – Real Python

Open Graph Title: Writing Clean, Pythonic Code With namedtuple (Summary) – Real Python

Description: In the previous lesson, I showed you how to create a subclass based on a named tuple. In this lesson, I’ll summarize the course. Named tuples make your code more readable than their non-named associates, and memory-wise have identical footprints…

Open Graph Description: In the previous lesson, I showed you how to create a subclass based on a named tuple. In this lesson, I’ll summarize the course. Named tuples make your code more readable than their non-named associates, and memory-wise have identical footprints…

Opengraph URL: https://realpython.com/lessons/python-namedtuple-summary/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
  {
    "@context": "https://schema.org",
    "@type": "VideoObject",
    "name": "Writing Clean, Pythonic Code With namedtuple (Summary)",
    "description": "In the previous lesson, I showed you how to create a subclass based on a named tuple. In this lesson, I’ll summarize the course. Named tuples make your code more readable than their non\u002Dnamed associates, and memory\u002Dwise have identical footprints…",
    "thumbnailUrl": ["https://files.realpython.com/media/Clean-Up-Your-Python-Code-With-namedtuple_Watermarked.0ab0ddbda383.jpg"],
    "uploadDate": "2023-02-28T14:00:00+00:00",
    "duration": "PT2M10S",
    
    "potentialAction": {
      "@type": "SeekToAction",
      "target": "https://realpython.com/lessons/python-namedtuple-summary/#t={seek_to_second_number}",
      "startOffset-input": "required name=seek_to_second_number"
    }
  }
  

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/Clean-Up-Your-Python-Code-With-namedtuple_Watermarked.0ab0ddbda383.jpg
og:imagehttps://files.realpython.com/media/Clean-Up-Your-Python-Code-With-namedtuple_Watermarked.0ab0ddbda383.jpg
twitter:creator@realpython
og:typevideo.episode

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/lessons/python-namedtuple-summary/
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/lessons/python-namedtuple-summary/
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Flessons%2Fpython-namedtuple-summary%2F
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-namedtuple
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-namedtuple
https://realpython.com/courses/python-namedtuple/#team
Writing Clean, Pythonic Code With namedtuplehttps://realpython.com/courses/python-namedtuple/
Christopher Trudeauhttps://realpython.com/courses/python-namedtuple/#team
Recommended Tutorialhttps://realpython.com/python-namedtuple/
Course Slides (.pdf)https://realpython.com/courses/python-namedtuple/downloads/python-namedtuple-slides/
Sample Code (.zip)https://realpython.com/courses/python-namedtuple/downloads/python-namedtuple-code/
Ask a Questionhttps://realpython.com/lessons/python-namedtuple-summary/#discussion
https://realpython.com/feedback/survey/course/python-namedtuple/liked/?from=lesson-title
https://realpython.com/feedback/survey/course/python-namedtuple/disliked/?from=lesson-title
Contentshttps://realpython.com/lessons/python-namedtuple-summary/#description
Transcripthttps://realpython.com/lessons/python-namedtuple-summary/#transcript
Discussionhttps://realpython.com/lessons/python-namedtuple-summary/#discussion
Pythonichttps://realpython.com/learning-paths/writing-pythonic-code/
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson_preview&utm_content=python-namedtuple
Sign-Inhttps://realpython.com/account/login/
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson_preview&utm_content=python-namedtuple
Sign-Inhttps://realpython.com/account/login/
00:00https://realpython.com/lessons/python-namedtuple-summary/#t=0.59
In the previous lesson,https://realpython.com/lessons/python-namedtuple-summary/#t=0.59
I showed you how to create a subclass based on a named tuple. In this lesson,https://realpython.com/lessons/python-namedtuple-summary/#t=1.49
I’ll summarize the course. Named tupleshttps://realpython.com/lessons/python-namedtuple-summary/#t=5.45
make your code more readable than their non-named associates,https://realpython.com/lessons/python-namedtuple-summary/#t=9.54
and memory-wise have identical footprints.https://realpython.com/lessons/python-namedtuple-summary/#t=12.48
00:15https://realpython.com/lessons/python-namedtuple-summary/#t=15.91
You create a named tuple using the namedtuple() factory found in the collectionshttps://realpython.com/lessons/python-namedtuple-summary/#t=15.91
module.https://realpython.com/lessons/python-namedtuple-summary/#t=19.61
The factory takes a string containing the name of the class you want to createhttps://realpython.com/lessons/python-namedtuple-summary/#t=20.42
and the names of the attributes in the tuple.https://realpython.com/lessons/python-namedtuple-summary/#t=24.7
00:27https://realpython.com/lessons/python-namedtuple-summary/#t=27.42
You can specify the attribute names in a space- or comma-delimited stringhttps://realpython.com/lessons/python-namedtuple-summary/#t=27.42
or by using an iterable.https://realpython.com/lessons/python-namedtuple-summary/#t=32.13
The factory has optional arguments for turning on automatic field renaming,https://realpython.com/lessons/python-namedtuple-summary/#t=34.67
specifying default values, or altering the module name associated with thehttps://realpython.com/lessons/python-namedtuple-summary/#t=39.16
created class. Named tuples can make your code more readable by beinghttps://realpython.com/lessons/python-namedtuple-summary/#t=43.85
specific about the parts of a tuple through dot notation by making functions thathttps://realpython.com/lessons/python-namedtuple-summary/#t=49.03
return multiple values more explicit,https://realpython.com/lessons/python-namedtuple-summary/#t=53.27
reducing the number of arguments to a function, or grouping associated attributeshttps://realpython.com/lessons/python-namedtuple-summary/#t=55.3
of a chunk of data together.https://realpython.com/lessons/python-namedtuple-summary/#t=59.71
01:03https://realpython.com/lessons/python-namedtuple-summary/#t=63.35
Generally, named tuples take up less memory than most other data structures and havehttps://realpython.com/lessons/python-namedtuple-summary/#t=63.35
faster construction times than everything else except regular tuples.https://realpython.com/lessons/python-namedtuple-summary/#t=68.31
01:12https://realpython.com/lessons/python-namedtuple-summary/#t=72.54
They are immutable, though.https://realpython.com/lessons/python-namedtuple-summary/#t=72.54
If the program you’re writing needs the data to change,https://realpython.com/lessons/python-namedtuple-summary/#t=74.48
they might not be the best choice.https://realpython.com/lessons/python-namedtuple-summary/#t=76.94
01:20https://realpython.com/lessons/python-namedtuple-summary/#t=80.93
For more information on named tuples, visit the most excellent Python docs.https://realpython.com/lessons/python-namedtuple-summary/#t=80.93
If you’re thinking about understanding your code’s memory footprint,https://realpython.com/lessons/python-namedtuple-summary/#t=85.79
the pympler library is a useful profiling tool.https://realpython.com/lessons/python-namedtuple-summary/#t=88.92
01:33https://realpython.com/lessons/python-namedtuple-summary/#t=93.2
Or if you’re interested in the speed part of performance,https://realpython.com/lessons/python-namedtuple-summary/#t=93.2
this article shows you different ways of measuring that.https://realpython.com/lessons/python-namedtuple-summary/#t=95.87
01:40https://realpython.com/lessons/python-namedtuple-summary/#t=100.95
For more information on tuples and other data structures,https://realpython.com/lessons/python-namedtuple-summary/#t=100.95
you can dig further into some Real Python content.https://realpython.com/lessons/python-namedtuple-summary/#t=103.73
This first article compares lists and tuples and is available as both a writtenhttps://realpython.com/lessons/python-namedtuple-summary/#t=106.64
tutorial and a video course,https://realpython.com/lessons/python-namedtuple-summary/#t=111.81
or if you want to go real deep on Python data structures,https://realpython.com/lessons/python-namedtuple-summary/#t=114.48
this guide is exhaustive,https://realpython.com/lessons/python-namedtuple-summary/#t=117.47
so much so the corresponding video course comes in three parts.https://realpython.com/lessons/python-namedtuple-summary/#t=119.6
02:05https://realpython.com/lessons/python-namedtuple-summary/#t=125.36
Thanks for your attention. I hope you enjoyed the course.https://realpython.com/lessons/python-namedtuple-summary/#t=125.36
Become a Memberhttps://realpython.com/account/join/
https://realpython.com/lessons/writing-clean-pythonic-code-with-namedtuple-quiz/
Overviewhttps://realpython.com/courses/python-namedtuple/
Writing Clean, Pythonic Code With namedtuple (Overview) 01:42 https://realpython.com/videos/python-namedtuple-overview/
Using namedtuple 09:47 https://realpython.com/videos/use-namedtuple/
Providing Optional Factory Arguments 05:41 https://realpython.com/lessons/optional-factory-arguments-namedtuple/
Understanding namedtuple Class Utilities 04:05 https://realpython.com/lessons/class-utilities-namedtuple/
Writing Cleaner Code 08:02 https://realpython.com/lessons/cleaner-code-namedtuple/
Comparing Data Structures 05:17 https://realpython.com/lessons/compare-data-structures-namedtuple/
Extending namedtuple Classes 04:03 https://realpython.com/lessons/extend-namedtuple-classes/
Writing Clean, Pythonic Code With namedtuple (Quiz) 07:30 https://realpython.com/lessons/writing-clean-pythonic-code-with-namedtuple-quiz/
Writing Clean, Pythonic Code With namedtuple (Summary) 02:10 https://realpython.com/lessons/python-namedtuple-summary/
Privacy Policyhttps://realpython.com/privacy-policy/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.