DescriptionThis training looks at all aspects of object-oriented programming in Python. We’ll start from encapsulation and an interesting key word __slots__, and then discuss why we need packages and how to make a virtual “sandbox” for a Python project.
Next we review function as an object and learn why it’s useful for a developer. This section focuses on an important theme – decorator, which can greatly simplify your code with cross-functionality. Then we move to the object life cycle, and learn how to create your own type on the basis of existing base types and why it is necessary, and what happens when and how an object is created and destroyed.
After this, you will learn how to return resources to the system, which it lends to the developer who does not always returns them. You’ll learn how to guarantee that by using the context manager. We’ll see how to sum up, extract and multiply user classes by using Python’s magic methods.
And last but not least we’ll discuss how to hide the algorithm for bypassing data structures or data generation based on iterates, yield operators, and review the method of data structure generation by using simplified Python syntax.
is issued on the Luxoft Training form
- Learn about the advanced features of Python for creating highly efficient and re-usable code
- Basic general programming knowledge
- Ability to understand logical code flows
- Python basics course or previous contact with Python
Python best practices
- Code documenting
- Static fields and methods
- Organizing code by modules
Function as object
- Working with function parameters
Object life cycle
- Customizing object creation
- Handling non-existing fields and methods of an object
- Customizing object destruction
Working with resources
- Context manager
- Implementing your own context manager
- Magic methods for object comparison operation
- Magic methods for implementing arithmetic operations and typing operation
- Magic methods for customizing object view in output flow
- Magic methods for customizing object cloning
Iterator and generator
- Concept of iterator
- Implementing a classical iterator in Python
- Yield operator
- Data structure generators based on list comprehensive statements