Package pyamf :: Package adapters :: Module _decimal
[hide private]
[frames] | no frames]

Module _decimal

source code

Adapter for the decimal module.


Since: 0.4

Functions [hide private]
 
convert_Decimal(x, encoder)
Called when an instance of decimal.Decimal is about to be encoded to an AMF stream.
source code

Imports: decimal, pyamf


Function Details [hide private]

convert_Decimal(x, encoder)

source code 

Called when an instance of decimal.Decimal is about to be encoded to an AMF stream.

Parameters:
  • x - The decimal.Decimal instance to encode.
  • encoder - The pyamf.BaseEncoder instance about to perform the operation.
Returns:
If the encoder is in 'strict' mode then x will be converted to a float. Otherwise an pyamf.EncodeError with a friendly message is raised.