abc
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/abc.py
Module Docs

Abstract Base Classes (ABCs) according to PEP 3119.

 
Modules
       
types

 
Classes
       
__builtin__.property(__builtin__.object)
abstractproperty
__builtin__.type(__builtin__.object)
ABCMeta

 
class ABCMeta(__builtin__.type)
    Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).
 
 
Method resolution order:
ABCMeta
__builtin__.type
__builtin__.object

Methods defined here:
__instancecheck__(cls, instance)
Override for isinstance(instance, cls).
__subclasscheck__(cls, subclass)
Override for issubclass(subclass, cls).
register(cls, subclass)
Register a virtual subclass of an ABC.

Static methods defined here:
__new__(mcls, name, bases, namespace)

Methods inherited from __builtin__.type:
__call__(...)
x.__call__(...) <==> x(...)
__delattr__(...)
x.__delattr__('name') <==> del x.name
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__subclasses__(...)
__subclasses__() -> list of immediate subclasses
mro(...)
mro() -> list
return a type's method resolution order

Data descriptors inherited from __builtin__.type:
__abstractmethods__
__base__
__bases__
__basicsize__
__dict__
__dictoffset__
__flags__
__itemsize__
__mro__
__weakrefoffset__

 
class abstractproperty(__builtin__.property)
    A decorator indicating abstract properties.
 
Requires that the metaclass is ABCMeta or derived from it.  A
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract properties are overridden.
The abstract properties can be called using any of the normal
'super' call mechanisms.
 
Usage:
 
    class C:
        __metaclass__ = ABCMeta
        @abstractproperty
        def my_abstract_property(self):
            ...
 
This defines a read-only property; you can also define a read-write
abstract property using the 'long' form of property declaration:
 
    class C:
        __metaclass__ = ABCMeta
        def getx(self): ...
        def setx(self, value): ...
        x = abstractproperty(getx, setx)
 
 
Method resolution order:
abstractproperty
__builtin__.property
__builtin__.object

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
__isabstractmethod__ = True

Methods inherited from __builtin__.property:
__delete__(...)
descr.__delete__(obj)
__get__(...)
descr.__get__(obj[, type]) -> value
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
__set__(...)
descr.__set__(obj, value)
deleter(...)
Descriptor to change the deleter on a property.
getter(...)
Descriptor to change the getter on a property.
setter(...)
Descriptor to change the setter on a property.

Data descriptors inherited from __builtin__.property:
fdel
fget
fset

Data and other attributes inherited from __builtin__.property:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
abstractmethod(funcobj)
A decorator indicating abstract methods.
 
Requires that the metaclass is ABCMeta or derived from it.  A
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract methods are overridden.
The abstract methods can be called using any of the normal
'super' call mechanisms.
 
Usage:
 
    class C:
        __metaclass__ = ABCMeta
        @abstractmethod
        def my_abstract_method(self, ...):
            ...