Review OOP and Async

It’s fun to enhance by reviewing OOP in Python again: concepts are class, method, instance/object, class method, instance method, attributes

Python can do monkey patching, meaning dynamically pass attribute or method to a class or instance/object. for example

Note attaching attributes is common and feasible in Python, and attaching methods, even if it’s also feasible, is more delicate and not recommended to do without a deep understanding of Python’s underlying mechanisms.

AsyncIO, how to use async, await and asyncio module, note this is a built-in module.

Now with async the syntax be modified as

if not use batch you can also write

This is from Socratica, an exceptional education org.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.