Found 201 bookmarks
Newest
Please don't hijack my Python root logger
Please don't hijack my Python root logger
With the recent explosion of LLM tools, I often like to kill time fiddling with different LLM client libraries and SDKs in one-off scripts. Lately, I’ve noticed that some newer tools frequently mess up the logger settings, meddling with my application logs. While it’s less common in more seasoned libraries, I guess it’s worth rehashing why hijacking the root logger isn’t a good idea when writing libraries or other forms of reusable code.
·rednafi.com·
Please don't hijack my Python root logger
Asyncio gather() In The Background - Super Fast Python
Asyncio gather() In The Background - Super Fast Python
We can run asyncio.gather() in the background by not awaiting the call to asyncio.gather(). The asyncio.gather() returns an asyncio.Future that does not have to be awaited. It is scheduled for execution in the asyncio event loop, along with all coroutines provided to the gather. Therefore, the caller is free to proceed with other activities and […]
·superfastpython.com·
Asyncio gather() In The Background - Super Fast Python
GitHub - fastapi/full-stack-fastapi-template: Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
GitHub - fastapi/full-stack-fastapi-template: Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more. - fastapi/full-stack-fastapi-template
·github.com·
GitHub - fastapi/full-stack-fastapi-template: Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
Asyncio Event Loop in Separate Thread - Super Fast Python
Asyncio Event Loop in Separate Thread - Super Fast Python
We can run an asyncio event loop in a new thread by starting a new thread and configuring it to start or run an event loop. There are many approaches we can use to run an event loop in a new thread. The simplest is to configure a new thread to start an event loop […]
·superfastpython.com·
Asyncio Event Loop in Separate Thread - Super Fast Python
Asyncio gather() Handle Exceptions - Super Fast Python
Asyncio gather() Handle Exceptions - Super Fast Python
We can automatically handle exceptions in coroutines executed via asyncio.gather() by setting the “return_exceptions” argument to True. By default, if a coroutine is executed by asyncio.gather() fails with an unhandled exception, it will be propagated to the caller. Setting the “return_exceptions” argument to True will trap any unhandled exceptions and provide them as return values, […]
·superfastpython.com·
Asyncio gather() Handle Exceptions - Super Fast Python
Python's Built-in Functions: A Complete Exploration – Real Python
Python's Built-in Functions: A Complete Exploration – Real Python
In this tutorial, you'll learn the basics of working with Python's numerous built-in functions. You'll explore how to use these predefined functions to perform common tasks and operations, such as mathematical calculations, data type conversions, and string manipulations.
·realpython.com·
Python's Built-in Functions: A Complete Exploration – Real Python
Understanding the Python Mock Object Library – Real Python
Understanding the Python Mock Object Library – Real Python
In this tutorial, you'll learn how to use the Python mock object library, unittest.mock, to create and use mock objects to improve your tests. Obstacles like complex logic and unpredictable dependencies make writing valuable tests difficult, but unittest.mock can help you overcome these obstacles.
·realpython.com·
Understanding the Python Mock Object Library – Real Python
How to Web Scrape with HTTPX and Python
How to Web Scrape with HTTPX and Python
Intro to using Python's httpx library for web scraping. Proxy and user agent rotation and common web scraping challenges, tips and tricks.
·scrapfly.io·
How to Web Scrape with HTTPX and Python
Waiting in asyncio
Waiting in asyncio
One of the main appeals of using Python’s asyncio is being able to fire off many coroutines and run them concurrently. How many ways do you know for waiting for their results?
·hynek.me·
Waiting in asyncio
What Is the __pycache__ Folder in Python? – Real Python
What Is the __pycache__ Folder in Python? – Real Python
In this tutorial, you'll explore Python's __pycache__ folder. You'll learn about when and why the interpreter creates these folders, and you'll customize their default behavior. Finally, you'll take a look under the hood of the cached .pyc files.
·realpython.com·
What Is the __pycache__ Folder in Python? – Real Python
An Intro to Logging with Loguru
An Intro to Logging with Loguru
Python's logging module isn't the only way to create logs. There are several third-party packages you can use, too. One of the most popular is Loguru. Loguru intends to remove all the boilerplate you get with the Python logging API. You will find that Loguru greatly simplifies creating logs in Python.
·pythonpapers.com·
An Intro to Logging with Loguru
Symbolica
Symbolica
Symbolica is a blazing fast computer algebra system.
·symbolica.io·
Symbolica
Python Sequences: A Comprehensive Guide – Real Python
Python Sequences: A Comprehensive Guide – Real Python
This tutorial dives into Python sequences, which is one of the main categories of data types. You'll learn about the properties that make an object a sequence and how to create user-defined sequences.
·realpython.com·
Python Sequences: A Comprehensive Guide – Real Python
Asyncio Run Multiple Concurrent Event Loops - Super Fast Python
Asyncio Run Multiple Concurrent Event Loops - Super Fast Python
We can run multiple concurrent asyncio event loops by starting and running each new event loop in a separate thread. Each thread can host and manage one event loop. This means we can start one thread per event loop we require, allowing a program to potentially scale from thousands to millions of coroutines. In this […]
·superfastpython.com·
Asyncio Run Multiple Concurrent Event Loops - Super Fast Python