Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

An apply function for Python 2 and 3

Project Description

Package Contents

apply(object, args=None, kwargs=None)
Call object with args and kwargs; return its results.


Python 3 has no apply. We like apply. I you like apply as well, have no fear. This version of apply works across all versions of Python.


apply allows to create read/write properties in a very compact way:

from apply import apply

class X509:

    def __init__(self, store): = store

    def CN():
        doc = 'The common name attribute'
        def get(self):
        def set(self, value):
  'CN', value)
        return property(get, set, doc=doc)

record = X509(LDAP())
record.CN = 'Slate Rock and Gravel Company'


1.4 - 2017-02-05

  • Support Python 2.6-3.6 without 2to3. [stefan]
  • Add a LICENSE file. [stefan]

1.3 - 2014-04-19

  • Remove setuptools from install_requires because it isn’t. [stefan]

1.2 - 2011-11-26

  • Update README. [stefan]

1.1 - 2011-11-26

  • Fix function signature. [stefan]

1.0 - 2011-11-25

  • Initial release. [stefan]

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(13.2 kB) Copy SHA256 Hash SHA256
Source None Feb 5, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate