Python: How to extract only tables from raw HTML
Overview Extracting tables from raw HTML strings can be incredibly useful for data scientists, web developers, and anyone needing to parse and analyze web data. This tutorial will…
Fixing Python NameError – name ‘List’ is not defined
Understanding the Issue Experiencing a NameError in Python, particularly one that mentions ‘List’ is not defined, can be a stumbling block for both newcomers and experienced developers alike….
Python: Using Type Hints when Handling Exceptions with Try/Catch
Introduction Python’s type hinting system, introduced in PEP 484, has steadily gained traction for promoting code clarity and aiding in static analysis. While commonly used for variables and…
Python typing.Annotated examples
Introduction Type checking in Python serves as a syntax for declaring types of variables, function parameters, and return values. It helps in early detection of potential errors, makes…
Python: Search and download photos by keyword from Unsplash API
Overview Ever stumbled upon the perfect photo on Unsplash for your project or presentation but didn’t know how to automatically retrieve similar ones using code? In this guide,…
Python: Add Type Annotations when Unpacking Tuples
Introduction In modern Python development, adding type annotations has become increasingly popular for enhancing code readability, maintainability, and leveraging static type checking tools like Mypy. Type annotations add…
Using TypeVar in modern Python: A practical guide
Overview Type variables in Python, introduced via the TypeVar function, are a significant part of the type hinting system that has been gradually integrated into Python since version…
Recursive Types in Modern Python: A Practical Guide
Overview Recursive types allow for the definition of data structures that can recursively include instances of themselves. This concept is particularly useful in languages like Python, where the…
Python: Using dependent types for input/return of function
Introduction In the expanding world of software development, type systems play a crucial role in defining the behavior of variables and functions. Recently, the concept of dependent types…
Python: Using type hints with datetime and timestamp
Introduction Type hinting in Python is a great feature that came along with Python 3.5 through PEP 484. It allows programmers to explicitly declare the expected data types…