Writing Pythonic code is an in-demand skill in the Python development space. Pythonic code is readable, explicit, clean, maintainable, and takes advantage of Python idioms and best practices. In this video course, you learned about creating namedtuple
classes and instances and how they can help you improve the quality of your Python code.
In this video course, you learned:
- How to create and use
namedtuple
classes and instances - How to take advantage of cool
namedtuple
features - When to use
namedtuple
instances to write Pythonic code - When to use a
namedtuple
instead of a similar data structure - How to subclass a
namedtuple
to add new features
With this knowledge, you can deeply improve the quality of your existing and future code. If you frequently use tuples, then consider turning them into named tuples whenever it makes sense. Doing so will make your code much more readable and Pythonic.
To learn more about the concepts in this course, check out the following resources: