Package topo :: Package command :: Module basic :: Class CommandMetaclass
[hide private]
[frames] | no frames]

Type CommandMetaclass

source code


A class having this as a metaclass will have its __call__() method automatically wrapped so that any exception occurring inside __call__() will be passed to the class's _except() method.
Instance Methods [hide private]

Inherited from param.parameterized.ParameterizedMetaclass: __init__, __setattr__, get_param_descriptor

Inherited from type: __call__, __cmp__, __delattr__, __eq__, __ge__, __getattribute__, __gt__, __hash__, __le__, __lt__, __ne__, __repr__, __subclasses__, mro

Inherited from object: __format__, __reduce__, __reduce_ex__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_safecall(mcs, fn)
classmethod(function) -> method
source code
Static Methods [hide private]
 
__new__(mcs, classname, bases, classdict)
staticmethod(function) -> method
source code
Properties [hide private]

Inherited from param.parameterized.ParameterizedMetaclass: abstract

Inherited from type: __abstractmethods__, __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __instancecheck__, __itemsize__, __mro__, __name__, __subclasscheck__, __weakrefoffset__

Inherited from object: __class__

Method Details [hide private]

__new__(mcs, classname, bases, classdict)
Static Method

source code 

staticmethod(function) -> method

Convert a function to be a static method.

A static method does not receive an implicit first argument. To declare a static method, use this idiom:

class C:
def f(arg1, arg2, ...): ... f = staticmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.

Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.

Overrides: object.__new__
(inherited documentation)

_safecall(mcs, fn)
Class Method

source code 

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:
def f(cls, arg1, arg2, ...): ... f = classmethod(f)

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.