Module Expr Str ClassDef bases body Assign NameStore Num FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad AugAssignAdd AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareGt NameLoad Num body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad Str decorator_list decorator_list ClassDef bases body Assign NameStore Call NameLoad Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A 

A line item for a bulk food order has description, weight and price fields::

    >>> raisins = LineItem('Golden raisins', 10, 6.95)
    >>> raisins.weight, raisins.description, raisins.price
    (10, 'Golden raisins', 6.95)

A ``subtotal`` method gives the total price for that line item::

    >>> raisins.subtotal()
    69.5

The weight of a ``LineItem`` must be greater than 0::

    >>> raisins.weight = -20
    Traceback (most recent call last):
        ...
    ValueError: value must be > 0

No change was made::

    >>> raisins.weight
    10

The value of the attributes managed by the descriptors are stored in
alternate attributes, created by the descriptors in each ``LineItem``
instance::

    >>> raisins = LineItem('Golden raisins', 10, 6.95)
    >>> dir(raisins)  # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
    ['_Quantity#0', '_Quantity#1', '__class__', ...
     'description', 'price', 'subtotal', 'weight']
    >>> getattr(raisins, '_Quantity#0')
    10
    >>> getattr(raisins, '_Quantity#1')
    6.95

 Quantity N/A N/A N/A __counter 0 __init__ N/A N/A self N/A N/A N/A cls N/A self __class__ N/A prefix N/A cls __name__ N/A index N/A cls __counter N/A N/A self storage_name N/A N/A _{}#{} format prefix index N/A N/A cls __counter 1 N/A __get__ N/A N/A self instance owner N/A N/A N/A N/A getattr instance N/A self storage_name N/A __set__ N/A N/A self instance value N/A N/A N/A N/A value 0 N/A N/A N/A setattr instance N/A self storage_name value N/A N/A N/A ValueError value must be > 0 N/A N/A LineItem N/A N/A N/A weight N/A Quantity N/A price N/A Quantity __init__ N/A N/A self description weight price N/A N/A N/A N/A self description description N/A N/A self weight weight N/A N/A self price price N/A subtotal N/A N/A self N/A N/A N/A N/A N/A self weight N/A self price N/A N/A