'Construct an AttributeImpl.
\class_
associated class
key
string name of the attribute
\callable_
optional function which generates a callable based on a parent
instance, which produces the "default" values for a scalar or
collection attribute when it\'s first accessed, if not present
already.
trackparent
if True, attempt to track if an instance has a parent attached
to it via this attribute.
extension
a single or list of AttributeExtension object(s) which will
receive set/delete/append/remove/etc. events.  Deprecated.
The event package is now used.
compare_function
a function that compares two values which are normally
assignable to this attribute.
active_history
indicates that get_history() should always return the "old" value,
even if it means executing a lazy callable upon attribute change.
parent_token
Usually references the MapperProperty, used as a key for
the hasparent() function to identify an "owning" attribute.
Allows multiple AttributeImpls to all match a single
owner attribute.
expire_missing
if False, don\'t add an "expiry" callable to this attribute
during state.expire_attributes(None), if no value is present
for this key.
send_modified_events
if False, the InstanceState._modified_event method will have no effect;
this means the attribute will never show up as changed in a
history entry.'

def __init__(self, class_, key, callable_, dispatch, trackparent=False, extension=None, compare_function=None, active_history=False, parent_token=None, expire_missing=True, send_modified_events=True, **kwargs):

    self.class_ = class_
    self.key = key
    self.callable_ = callable_
    self.dispatch = dispatch
    self.trackparent = trackparent
    self.parent_token = (parent_token or self)
    self.send_modified_events = send_modified_events
    if (compare_function is None):
        self.is_equal = operator.eq
    else:
        self.is_equal = compare_function
    attr = manager_of_class(class_)[key]
    for ext in util.to_list((extension or [])):
        ext._adapt_listener(attr, ext)
    if active_history:
        self.dispatch._active_history = True
    self.expire_missing = expire_missing
