Skip to content

Latest commit

 

History

History
85 lines (45 loc) · 4.21 KB

File metadata and controls

85 lines (45 loc) · 4.21 KB

Week 3

Asynchronous operations

Python offers several options for managing long running operations asynchronously. asyncio is the core library for supporting asynchronous operations, including async/await.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.

Classes

Classes define data structures and behavior. Classes allow you to group data and functionality together.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.

Managing the file system

Python's pathlib provides operations and classes to access files and directories in the file system.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn

Style Guidelines

Formatting

Formatting makes code readable and easier to debug.

Documentation

  • PEP 8 is a set of coding conventions for Python code
  • Docstring is the standard for documenting a module, function, class or method definition

Linting

Linting helps you identify formatting and convention issues in your Python code

  • Pylint Pylint is a linter for Python to help enforce coding standards and check for errors in Python code
  • Linting Python in Visual Studio Code will show you how to enable litners in VS Code
  • Type hints allow some interactive development environments and linters to enforce types

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.

Inheritance

Inheritance allows you to define a class that inherits all the methods and properties from another class. The parent or base class is the class being inherited from. The child or derived class is the class that inherits from another class.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.

Lambdas

A lambda function is a small anonymous function. It can take any number of arguments but can only execute one expression.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.

Mixins (multiple inheritance)

Python allows you to inherit from multiple classes. While the technical term for this is multiple inheritance, many developers refer to the use of more than one base class adding a mixin. These are commonly used in frameworks such as Django.

Microsoft Learn Resources

Explore related tutorials on Microsoft Learn.