SequoiaDB
 All Classes Functions
Public Member Functions | List of all members
bson.binary.Binary Class Reference
Inheritance diagram for bson.binary.Binary:
bson.binary.UUIDLegacy

Public Member Functions

def __new__
 
def subtype
 
def __getnewargs__
 
def __eq__
 
def __ne__
 
def __repr__
 

Detailed Description

Representation of BSON binary data.

This is necessary because we want to represent Python strings as
the BSON string type. We need to wrap binary data so we can tell
the difference between what should be considered binary data and
what should be considered a string when we encode to BSON.

Raises TypeError if `data` is not an instance of :class:`str`
(:class:`bytes` in python 3) or `subtype` is not an instance of
:class:`int`. Raises ValueError if `subtype` is not in [0, 256).

.. note::
  In python 3 instances of Binary with subtype 0 will be decoded
  directly to :class:`bytes`.

:Parameters:
  - `data`: the binary data to represent
  - `subtype` (optional): the `binary subtype
    <http://bsonspec.org/#/specification>`_
    to use

Member Function Documentation

def bson.binary.Binary.subtype (   self)
Subtype of this binary data.

The documentation for this class was generated from the following file: