Skip to main content

An instance method decorator that also works as a classmethod.

Project description

#Dynamic class and instance methods!
This simple module creates a class method that will also work as an instance method.

import dynamicmethod

class Example(object):

x = 1 # Default classmethod value

def __init__(self, x=0):
self.x = x

def get_x(self):
return self.x

ex = Example()
ex.x = 5

Project details

Download files

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

Files for dynamicmethod, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size dynamicmethod-1.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

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