*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 Answer from Deleted User on reddit.com
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Python - Visual Studio Marketplace
March 27, 2026 - 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
It is quite easy to add new built-in modules to Python, if you know how to program in C. Such extension modules can do two things that can’t be done directly in Python: they can implement new built-in object types, and they can call C library functions and system calls.
🌐
Tutorialspoint
tutorialspoint.com › home › python › python further extensions
Unlock Advanced Python Extensions
February 13, 2026 - Discover advanced Python extensions and features to elevate your coding skills. Dive into modules and packages for enhanced functionality.
🌐
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?

🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › top-vs-code-extensions-for-python
Top 10 VS Code Extensions For Python [2025] - GeeksforGeeks
July 23, 2025 - It provides features like analyzing code for potential errors, code formatting, debugging through a debug console, testing with the unit test, pytest, and nose test frameworks. Syntax checking, auto-completion, auto-activation, and switching between different environments are also done by this extension. Moreover, it supports Jupyter Notebooks and therefore is considered as the very basic and important Python extension.
🌐
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
🌐
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...
🌐
PyPI
pypi.org › project › extensions
extensions · PyPI
extensions is a simple plugin system inspired from setuptools entry points [1]. It allows an application to define and/or use plugins.
      » pip install extensions
    
Published   May 17, 2010
Version   0.4
🌐
Python Land
python.land › home › creating python programs › vscode python extensions
VSCode Python Extensions • Python Land Tutorial
September 5, 2025 - You can click the extensions to read more about them and press the install button to install an extension. You at least want to install the official Python extension for Python programming. It offers many features 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 › 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 ...
🌐
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 › 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.
🌐
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.
🌐
Towards The Cloud
towardsthecloud.com › blog › best-vscode-extensions-python
10 Best VS Code Extensions for Python Developers (2026) | Towards The Cloud
March 26, 2026 - The 10 best VS Code extensions for Python developers: Pylance, Python by Microsoft, Sourcery, and more. Tested and reviewed for code quality and productivity.
🌐
Visual Studio Code
code.visualstudio.com › api › advanced-topics › python-extension-template
Authoring Python Extensions | Visual Studio Code Extension API
November 3, 2021 - After creating your extension via the template, it will include the following extension contributions. Assume <pytool-module> was replaced with mytool, and <pytool-display-name> withMy Tool: A command My Tool: Restart Server (command ID: mytool.restart). ... On Language python.
Top answer
1 of 3
578
  1. .py: This is normally the input source code that you've written.
  2. .pyc: This is the compiled bytecode. If you import a module, python will build a *.pyc file that contains the bytecode to make importing it again later easier (and faster).
  3. .pyo: This was a file format used before Python 3.5 for *.pyc files that were created with optimizations (-O) flag. (see the note below)
  4. .pyd: This is basically a windows dll file. http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll

Also for some further discussion on .pyc vs .pyo, take a look at: http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html (I've copied the important part below)

  • When the Python interpreter is invoked with the -O flag, optimized code is generated and stored in ‘.pyo’ files. The optimizer currently doesn't help much; it only removes assert statements. When -O is used, all bytecode is optimized; .pyc files are ignored and .py files are compiled to optimized bytecode.
  • Passing two -O flags to the Python interpreter (-OO) will cause the bytecode compiler to perform optimizations that could in some rare cases result in malfunctioning programs. Currently only __doc__ strings are removed from the bytecode, resulting in more compact ‘.pyo’ files. Since some programs may rely on having these available, you should only use this option if you know what you're doing.
  • A program doesn't run any faster when it is read from a ‘.pyc’ or ‘.pyo’ file than when it is read from a ‘.py’ file; the only thing that's faster about ‘.pyc’ or ‘.pyo’ files is the speed with which they are loaded.
  • When a script is run by giving its name on the command line, the bytecode for the script is never written to a ‘.pyc’ or ‘.pyo’ file. Thus, the startup time of a script may be reduced by moving most of its code to a module and having a small bootstrap script that imports that module. It is also possible to name a ‘.pyc’ or ‘.pyo’ file directly on the command line.

Note:

On 2015-09-15 the Python 3.5 release implemented PEP-488 and eliminated .pyo files. This means that .pyc files represent both unoptimized and optimized bytecode.

2 of 3
291
  • .py - Regular script
  • .py3 - (rarely used) Python3 script. Python3 scripts usually end with ".py" not ".py3", but I have seen that a few times
  • .pyc - compiled script (Bytecode)
  • .pyo - optimized pyc file (As of Python3.5, Python will only use pyc rather than pyo and pyc)
  • .pyw - Python script to run in Windowed mode, without a console; executed with pythonw.exe
  • .pyx - Cython src to be converted to C/C++
  • .pyd - Python script made as a Windows DLL
  • .pxd - Cython modern header for use with cimports.
  • .pxi - Cython legacy header for raw text includes.
  • .pyi - Stub file (PEP 484)
  • .pyz - Python script archive (PEP 441); this is a script containing compressed Python scripts (ZIP) in binary form after the standard Python script header
  • .pyzw - Python script archive for MS-Windows (PEP 441); this is a script containing compressed Python scripts (ZIP) in binary form after the standard Python script header
  • .py[cod] - wildcard notation in ".gitignore" that means the file may be ".pyc", ".pyo", or ".pyd".
  • .pth - a path configuration file; its contents are additional items (one per line) to be added to sys.path. See site module.
  • .egg - special zip used for distribution/import, mostly obsolete since PEP 427
  • .whl - special zip used for distribution only, widely used by pip

A larger list of additional Python file-extensions (mostly rare and unofficial) can be found at http://dcjtech.info/topic/python-file-extensions/

🌐
Medium
medium.com › mlearning-ai › 9-useful-python-extensions-for-visual-studio-code-bf749d809855
9 Useful Python Extensions for Visual Studio Code | by Asadullah Dal | Medium
December 26, 2022 - Select the Python interpreter, from available Python virtual/conda environments. Provides the options to select Linter and Code formats. ... The Extension comes as a pack with two more extensions.
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.

🌐
DEV Community
dev.to › bobbyiliev › 7-best-vs-code-extensions-for-python-developers-4e9d
7 Best VS Code Extensions for Python Developers - DEV Community
August 2, 2023 - Visual Studio Live Share is an extension that allows real-time collaboration with other developers, enabling you to share your code, workspace, and even terminal instances with others. This powerful tool is excellent for remote pair programming, code reviews, and group debugging sessions. ... Live Share supports Python development and seamlessly integrates with the Python extension by Microsoft, making it an invaluable tool for Python developers working in teams or on collaborative projects.