Software engineering and personal development

Tag: context

How to Simplify Error Handling with contextlib.suppress() in Python


Error handling is an essential aspect of writing reliable and robust Python code. Sometimes, however, there are scenarios where you want to intentionally ignore specific exceptions without interrupting the program’s execution flow. In such cases, Python contextlib.suppress() comes to the rescue. In this article, we’ll explore tip number 10: simplifying error handling with contextlib.suppress(), and discover how it allows you to suppress exceptions effectively.

Continue reading

How to Simplify the Management Resources in Python with Context Managers

In Python, managing resources such as files, network connections, or locks is a crucial aspect of writing robust and efficient code.

It’s essential to ensure that resources are properly allocated and released to avoid leaks or unexpected behavior.

Thankfully, Python provides an elegant solution for this problem: context managers.

In this article, we’ll explore how context managers simplify resource management and improve code readability.

Continue reading

Improve the quality of your written English using Grammarly

Img source: Chrome Web Store

We spend a lot of time online writing emails, writing reports or documents that we need, but not all of us are native speakers of English. Moreover, even native speakers can have mistakes here and there because they may be in a rush and can not notice a small typo that they may have done. Grammarly is a really helpful Chrome extension that I have been using for a few weeks now and I am really content with it.

Continue reading

© 2024 Fatos Morina

Theme by Anders NorenUp ↑