Wrap up
Topics: Wrap up
During the past 50 days we studied several highly useful Python concepts using a Magical Universe. Overall, we looked at the following concepts:
General Python concepts:
- Object oriented programming, how to use classes, how inheritance works, etc.
- The differences between class, instance and static methods
- How to convert objects to strings
- How to properly name variables and functions
- The ‘It’s easier to ask for forgiveness than permission’ EAFP principle
- The functioning of
if __name__ == '__name__'
- Testing code with pytest
Advanced Python concepts:
- How to use function annotations
- What decorators are and how we can use them, e.g. to create read-only properties
- Namedtuples
- Abstract Base Classes (ABC’s)
- Data classes
- How to create iterators and control their behavior
- Context managers and how to use the
with
statement - The
defaultdict
of thecollections
module
On the last days, we looked at the usage of configuration (config) files. All of these concepts have the potential to be used in our daily coding work. They can improve the readability, efficiency and understandability of our code. And with a little bit of magic it doesn’t seem so hard anymore, does it?
Happy coding!