?/100

The Single Most Useful Decorator in Python

December 12, 2020329226

Description

The most useful decorator in Python is @cache. It's from the functools library (and a similar variant called @lru_cache too). This decorator was introduced in Python 3.9, but lru_cache has been available since 3.2. Often times, the cache decorator can be used to automatically do dynamic programming algorithms. ā€• mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode SUPPORT ME ā­ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate BE ACTIVE IN MY COMMUNITY šŸ˜„ --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding

Wheatcha