earn the White PyBites Ninja earn the Yellow PyBites Ninja earn the Orange PyBites Ninja right arrow earn more PyBites Ninja belts and certificates
The best way to learn to code in Python is to actually use the language.

Our platform offers effective Test Driven Learning which will be key to your progress.


Join thousands of Pythonistas and start coding!


Join us on our PyBites Platform
Click here to code!

Learning Python Decorators by Example

Posted by Bob on Fri 20 October 2017 in Concepts • Tagged with decorators, design patterns, logging, caching, memoization, Flask, Django, properties, classmethod, staticmethod, lru_cache, mock.patch, contextmanager • 4 min read

Decorators are a sometimes overlooked feature and they might be hard to grasp for beginning Pythonistas. I agree with Aaron Maxwell that mastering them "can massively magnify the positive impact of the code you write", so make sure you add them to your toolkit if not done so already. In this article I explain what they do, why you want to use them and give some practical examples.


Continue reading

Code Challenge 14 - Write DRY Code With Decorators - Review

Posted by PyBites on Sat 15 April 2017 in Challenges • Tagged with codechallenges, learning, decorators, design patterns, DRY • 2 min read

It's end of the week again so we review the code challenge of this week. It's never late to sign up, just fork our challenges repo and start coding.


Continue reading

Code Challenge 14 - Write DRY Code With Decorators

Posted by PyBites on Mon 10 April 2017 in Challenges • Tagged with codechallenges, learning, decorators, design patterns, DRY • 2 min read

Hi Pythonistas, a new week, a new 'bite' of Python coding! This week we let you practice with decorators, a nice way to abstract away common functionality. It allows you to alter the behavior of a callable without modifying the callable itself. We agree with Dan Bader that 'understanding decorators is a milestone for any serious Python programmer.' Enjoy!


Continue reading