Skip to main content

Implements ``callable`` using ctypes (useful on CPython 3.0 and 3.1).

Project description

Implements callable using ctypes (useful on CPython 3.0 and 3.1, which is missing the callable function).

Versioning

This library’s version numbers follow the SemVer 2.0.0 specification.

Installation

pip install ctypes-callable

Usage

The use-case for using this module is if:

  1. You are using an early CPython 3 release missing callable.

  2. You cannot upgrade to a newer CPython 3 for some reason.

  3. You want to use code which uses the callable builtin.

To do this, run this before any code that uses callable (for example, usercustomize or sitecustomize might be good places):

import ctypes_callable
import builtins
builtins.callable = ctypes_callable.callable

Portability

This module will fail on import on Jython, IronPython, PyPy, MicroPython, PyPy.js, Brython, Transcrypt, and probably any other implementation besides CPython, because it relies on accessing the Python C API through ctypes.

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

ctypes-callable-1.0.4.tar.gz (2.8 kB view hashes)

Uploaded source

Built Distribution

ctypes_callable-1.0.4-py2.py3-none-any.whl (2.9 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page