DORSETRIGS
Home

python-internals (7 post)


posts by category not found!

How to inspect Python file/module information without using `__file__` — perhaps in a module-level `__getattr__(…)` function?

Peek Inside Python Modules Inspecting File Information Without file Have you ever needed to glean information about a Python module without resorting to the fam

2 min read 13-09-2024 76
How to inspect Python file/module information without using `__file__` — perhaps in a module-level `__getattr__(…)` function?
How to inspect Python file/module information without using `__file__` — perhaps in a module-level `__getattr__(…)` function?

When are .pyc files refreshed?

Understanding Pythons pyc Files When Are They Compiled Pythons pyc files are bytecode representations of your Python source code py files They are created at ru

2 min read 06-09-2024 45
When are .pyc files refreshed?
When are .pyc files refreshed?

Making an object x such that `x in [x]` returns False

The Curious Case of x in x in Python In the realm of Python programming the seemingly simple statement x in x often leads to unexpected behavior particularly wh

2 min read 06-09-2024 55
Making an object x such that `x in [x]` returns False
Making an object x such that `x in [x]` returns False

What does the following code do in cpython?

Unveiling the Mystery of C Pythons IS OP Implementation Why the XOR Delving into the core of C Pythons implementation we often encounter intriguing code snippet

2 min read 04-09-2024 57
What does the following code do in cpython?
What does the following code do in cpython?

Is there any way to construct a code object from a code string and assign it to an existing function using Python?

Dynamically Modifying Python Function Code A Deep Dive This article explores the intricate world of dynamically modifying Python functions at runtime We ll delv

2 min read 31-08-2024 70
Is there any way to construct a code object from a code string and assign it to an existing function using Python?
Is there any way to construct a code object from a code string and assign it to an existing function using Python?

What is the internal implementation of `copy.deepcopy()` in Python and how to override `__deepcopy__()` correctly?

Demystifying Pythons copy deepcopy and Overriding deepcopy The copy deepcopy function in Python creates a deep copy of an object recursively copying all nested

3 min read 31-08-2024 57
What is the internal implementation of `copy.deepcopy()` in Python and how to override `__deepcopy__()` correctly?
What is the internal implementation of `copy.deepcopy()` in Python and how to override `__deepcopy__()` correctly?

AsyncIO CPython hangs with 100% CPU usage

Unraveling the Mystery Why Your Async IO C Python Application Is Hanging Have you ever encountered a situation where your Python application particularly one he

3 min read 31-08-2024 77
AsyncIO CPython hangs with 100% CPU usage
AsyncIO CPython hangs with 100% CPU usage