Package topo :: Package param :: Module parameterized :: Class bothmethod
[hide private]
[frames] | no frames]

Class bothmethod

source code

object --+
         |
        bothmethod

'optional @classmethod'

A decorator that allows a method to receive either the class object (if called on the class) or the instance object (if called on the instance) as its first argument.

Code (but not documentation) copied from: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/523033.

Instance Methods [hide private]
 
__init__(self, func)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__get__(self, obj, type_=None) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, func)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)