Skip to main content

A ``singledispatch()`` for arguments that are classes annotated as specific types.

Project description

class_singledispatch Package version Supported Python versions

Tests Coverage Poetry Ruff Code style License Pre-commit

A singledispatch() for arguments that are classes annotated as specific types.

Inspired by https://github.com/python/cpython/issues/100623.

Installation

If you want to…

…use this tool in your project 💻

You might simply install it with pip:

pip install class-singledispatch

If you use Poetry, then run:

poetry add class-singledispatch

…contribute to class_singledispatch 🚀

[!Note] If you use Windows, it is highly recommended to complete the installation in the way presented below through WSL2.

  1. Fork the class_singledispatch repository on GitHub.

  2. Install Poetry.
    Poetry is an amazing tool for managing dependencies & virtual environments, building packages and publishing them. You might use pipx to install it globally (recommended):

    pipx install poetry
    

    If you encounter any problems, refer to the official documentation for the most up-to-date installation instructions.

    Be sure to have Python 3.8 installed—if you use pyenv, simply run:

    pyenv install 3.8
    
  3. Clone your fork locally and install dependencies.

    git clone https://github.com/your-username/class_singledispatch path/to/class_singledispatch
    cd path/to/class_singledispatch
    poetry env use $(cat .python-version)
    poetry install
    

    Next up, simply activate the virtual environment and install pre-commit hooks:

    poetry shell
    pre-commit install --hook-type pre-commit --hook-type pre-push
    

For more information on how to contribute, check out CONTRIBUTING.md.
Always happy to accept contributions! ❤️

Legal info

© Copyright by Bartosz Sławecki (@bswck).
This software is licensed under the terms of MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

class_singledispatch-1.0.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

class_singledispatch-1.0.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file class_singledispatch-1.0.0.tar.gz.

File metadata

  • Download URL: class_singledispatch-1.0.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for class_singledispatch-1.0.0.tar.gz
Algorithm Hash digest
SHA256 08ec68b7c69e918cdcbd01959d4804b1e3f63438c9c1f6425f42361d8147a7c1
MD5 440eeba8bf7e5adb38af979b80206ae1
BLAKE2b-256 32432b0cb9f0df2d6454780e09277a3c91a40de20bd04467d9bc017ea69cb088

See more details on using hashes here.

File details

Details for the file class_singledispatch-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for class_singledispatch-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33b5caf56b92194908f58168c8d0af53df1853bcc7606774f2f564d8f5c464b5
MD5 9423622ca2a6376673a66c8d351a4e4a
BLAKE2b-256 712fb136e86b59688676bed6010a16fa12c315f6dca6a095c44ce182797e9729

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page