🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Python - Visual Studio Marketplace
1 month ago - Extension for Visual Studio Code - Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.
🌐
Python
docs.python.org › 3 › extending › extending.html
1. Extending Python with C or C++ — Python 3.14.4 documentation
Let’s create an extension module called spam (the favorite food of Monty Python fans…) and let’s say we want to create a Python interface to the C library function system() [1]. This function takes a null-terminated character string as argument and returns an integer.
Discussions

What are your favorite extensions for VSCODE that make coding in Python easier?
*cracks knuckles* autoDocstring - because I want future me to not be angry at present me Error Lens - because I'm blind Even Better TOML - because anyone who hasn't switched over to pyproject.toml format should Jupyter - because data science pylens - because I'd like to know what dependencies have updated Python Indent - because I value my sanity Ruff - nice performant linter + isort functionality View Image for Python Debugging - if your data science work sometimes strays away from Jupyter notebooks, you'll understand why More on reddit.com
🌐 r/learnpython
52
204
June 28, 2023
Python extension methods - Stack Overflow
OK, in C# we have something like: public static string Destroy(this string s) { return ""; } So basically, when you have a string you can do: str = "This is my string to be destroyed"; news... More on stackoverflow.com
🌐 stackoverflow.com
A look into workflow tools - package management in the Python extension for VS Code - Packaging - Discussions on Python.org
I am one of the Program Managers working on the Python extension in VS Code! As part of my work, I have been taking a look at package management tools. The Python extension is considering ways in which we can improve the package management experience in the extension with a standard Python ... More on discuss.python.org
🌐 discuss.python.org
10
July 13, 2023
VS Code Extensions for Python
Sure. Python-specific extensions: Jupyter - for working with Jupyter notebooks (if needed) Mypy - type checking Pylance - alternative tool for type checking Ruff - the best and only linter you'll need Generic extensions: CodeSnap - useful for sharing code in image form, primarily for social media. Basically https://carbon.now.sh but as an extension. Even Better TOML - for pyproject.toml files file-tree-generator - for sharing your directory structure but being too lazy to make one by hand Hex Editor - for the rare occasion you need to dig into binary files HexInspector - see numbers in other number bases on hover Live Preview - lets you render web pages within VS Code with auto-refresh Markdown All in One - because you'll generally see plenty of Markdown in projects Markdown Preview Enhanced Snyk Security - helps find common security issues WSL - Better WSL integration Theme-wise I'm also fond of Material Icon Theme, Monokai Charcoal High Contrast, and Doki-Theme, but those aren't exactly useful. More on reddit.com
🌐 r/learnpython
12
57
August 3, 2024
🌐
GitHub
github.com › yzhang-gh › vscode-python
GitHub - yzhang-gh/vscode-python: Python extension for Visual Studio Code · GitHub
A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: 2.7, >=3.4), including features such as linting, debugging, IntelliSense, code navigation, code formatting, refactoring, ...
Author   yzhang-gh
🌐
Python
docs.python.org › 3 › extending › newtypes_tutorial.html
2. Defining Extension Types: Tutorial — Python 3.14.3 documentation
Python allows the writer of a C extension module to define new types that can be manipulated from Python code, much like the built-in str and list types. The code for all extension types follows a ...
🌐
Python
docs.python.org › 3 › extending › index.html
Extending and Embedding the Python Interpreter — Python 3.14.4 documentation
This document describes how to write modules in C or C++ to extend the Python interpreter with new modules. Those modules can not only define new functions but also new object types and their methods. The document also describes how to embed the Python interpreter in another application, for use as an extension language.
🌐
PyPI
pypi.org › project › Python-Extension
Python-Extension
A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings.
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › python
Python in Visual Studio Code
November 3, 2021 - Working with Python in Visual Studio Code, using the Microsoft Python extension, is simple, fun, and productive. The extension makes VS Code an excellent Python editor, and works on any operating system with a variety of Python interpreters.
🌐
DataSource.ai
datasource.ai › en › data-science-articles › top-10-python-extensions-for-visual-studio-code
Top 10 Python Extensions for Visual Studio Code
September 1, 2023 - Python extension for Visual Studio Code A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: >=3.6), including features such as IntelliSense (Pylance), linting, debugging, ...
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › what are your favorite extensions for vscode that make coding in python easier?
r/learnpython on Reddit: What are your favorite extensions for VSCODE that make coding in Python easier?
June 28, 2023 -

I just learned about autoDocstring last night and I'm blown away how nice this extension is. It makes creating docstrings so much easier and automated. Personally, I'm a fan of Google's style for docstrings so that's what I've set my default to when generating docstrings!

Another favorite extension of mine is this linter: Ruff. However, it is a bit buggy in that it duplicates functions at the bottom of the file, but other than that I love it!

Lastly, this is not an extension, but I love the Black library and auto-saving my .py files with this formatting provider in VSCODE.

I'm curious what this communities' favorite extensions are that make coding in Python easier or automated?

🌐
GeeksforGeeks
geeksforgeeks.org › python › top-vs-code-extensions-for-python
Top 10 VS Code Extensions For Python [2025] - GeeksforGeeks
July 23, 2025 - Python Snippets extension is very useful for beginners who are new to this language. It contains built-in snippets for lists, strings, dictionaries, tuple, class, etc with at least one example of each of them.
🌐
Python Developer's Guide
devguide.python.org › developer-workflow › extension-modules
Standard library extension modules - Python Developer's Guide
By convention, the source file containing the extension module implementation is called <NAME>module.c, where <NAME> is the name of the module that will be later imported (in our case _foo). In addition, the directory containing the implementation should also be named similarly. ... #ifndef _FOO_HELPER_H #define _FOO_HELPER_H #include "Python.h" typedef struct { /* ...
🌐
Python Land
python.land › home › creating python programs › vscode python extensions
VSCode Python Extensions • Python Land Tutorial
September 5, 2025 - You at least want to install the ... you’ll need, like IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, snippets, and more....
🌐
Python
docs.python.org › 3 › extending › building.html
4. Building C and C++ Extensions — Python 3.14.4 documentation
A C extension for CPython is a shared library (for example, a.so file on Linux,.pyd on Windows), which exports an initialization function. See Defining extension modules for details. Building C and...
Top answer
1 of 9
48

You can just modify the class directly, sometimes known as monkey patching.

def MyMethod(self):
      return self + self

MyClass.MyMethod = MyMethod
del(MyMethod)#clean up namespace

I'm not 100% sure you can do this on a special class like str, but it's fine for your user-defined classes.

Update

You confirm in a comment my suspicion that this is not possible for a builtin like str. In which case I believe there is no analogue to C# extension methods for such classes.

Finally, the convenience of these methods, in both C# and Python, comes with an associated risk. Using these techniques can make code more complex to understand and maintain.

2 of 9
22

I would use the Adapter pattern here. So, let's say we have a Person class and in one specific place we would like to add some health-related methods.

from dataclasses import dataclass


@dataclass
class Person:
    name: str
    height: float  # in meters
    mass: float  # in kg


class PersonMedicalAdapter:
    person: Person

    def __init__(self, person: Person):
        self.person = person

    def __getattr__(self, item):
        return getattr(self.person, item)

    def get_body_mass_index(self) -> float:
        return self.person.mass / self.person.height ** 2


if __name__ == '__main__':
    person = Person('John', height=1.7, mass=76)
    person_adapter = PersonMedicalAdapter(person)

    print(person_adapter.name)  # Call to Person object field
    print(person_adapter.get_body_mass_index())  # Call to wrapper object method

I consider it to be an easy-to-read, yet flexible and pythonic solution.

🌐
Python.org
discuss.python.org › packaging
A look into workflow tools - package management in the Python extension for VS Code - Packaging - Discussions on Python.org
July 13, 2023 - As part of my work, I have been taking a look at package management tools. The Python extension is considering ways in which we can improve the package management experience in the extension with a standard Python install with only pip and venv.
🌐
Real Python
realpython.com › build-python-c-extension-module
Building a Python C Extension Module – Real Python
June 27, 2023 - When you import your Python C extension module, PyInit_fputs() is the first method to be invoked. However, before a reference is returned to the Python interpreter, the function makes a subsequent call to PyModule_Create(). This will initialize the structures PyModuleDef and PyMethodDef, which hold meta information about your module.
🌐
Visual Studio Code
code.visualstudio.com › api › advanced-topics › python-extension-template
Authoring Python Extensions | Visual Studio Code Extension API
November 3, 2021 - Using the Python extension template and API to integrate linters, formatters, and language features into Visual Studio Code
🌐
GitHub
github.com › microsoft › vscode-python › releases
Releases · microsoft/vscode-python
March 11, 2026 - Python extension for Visual Studio Code. Contribute to microsoft/vscode-python development by creating an account on GitHub.
Author   microsoft