Member-only story

Python: Libraries you should use — Part-1

Gateway to Efficiency

Pravash
4 min readMay 15, 2024

Hi, Welcome to this article of exploration into Python’s vast library ecosystem! In this segment, I will share some of the coolest Python libraries which have become essential in my coding journey and that I think you might don’t know about them.

Let’s dive in —

1. result

The concept of result introduces the capability for parallel path programming. It facilitates the handling of errors represented through abstract data types, commonly known as monads or monadic structures.

These offer an alternative approach to error handling compared to using exceptions. Many individuals prefer this method over Python’s exception handling, as exceptions tend to disrupt the main program’s control flow.

This approach draws inspiration from functional programming principles. Instead of solely returning an alternative result value or raising an error, it allows for the return of a result value, which can be either Ok(value) or Err(error). This design fosters clearer error management within the program’s structure.

Example —

using try/except block:

def divide(a: int, b: int) -> int:
try:
if b == 0:
raise…

--

--

Pravash
Pravash

Written by Pravash

I am a passionate Data Engineer and Technology Enthusiast. Here I am using this platform to share my knowledge and experience on tech stacks.

Responses (4)