From fccd213a2c18196147f0ee9b87f8eff5956f1008 Mon Sep 17 00:00:00 2001 From: behackett Date: Fri, 22 Jul 2011 14:11:42 -0700 Subject: [PATCH] A few doctest fixes. --- doc/examples/geo.rst | 3 ++- doc/faq.rst | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/examples/geo.rst b/doc/examples/geo.rst index a39c1efc6..62c114f12 100644 --- a/doc/examples/geo.rst +++ b/doc/examples/geo.rst @@ -67,8 +67,8 @@ It's also possible to query for all items within a given rectangle >>> for doc in db.places.find({"loc": {"$within": {"$box": [[2, 2], [5, 6]]}}}): ... repr(doc) ... - "{u'loc': [4, 4], u'_id': ObjectId('...')}" "{u'loc': [2, 5], u'_id': ObjectId('...')}" + "{u'loc': [4, 4], u'_id': ObjectId('...')}" Or circle (specified by center point and radius): @@ -87,4 +87,5 @@ geoNear queries are also supported using :class:`~bson.son.SON`: >>> from bson.son import SON >>> db.command(SON([('geoNear', 'places'), ('near', [1, 2])])) + {u'ok': 1.0, u'near': u'1100000000000001100111100111100000000001100111100111', u'ns': u'geo_example.places', u'stats': ...} diff --git a/doc/faq.rst b/doc/faq.rst index 9dfe474f0..648e62c06 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -69,10 +69,8 @@ I'm saving ``9.99`` but when I query my document contains ``9.9900000000000002`` The database representation is ``9.99`` as an IEEE floating point (which is common to MongoDB and Python as well as most other modern languages). The problem is that ``9.99`` cannot be represented exactly -with a double precision floating point - this is true in Python as -well: - -.. doctest:: +with a double precision floating point - this is true in some versions of +Python as well: >>> 9.99 9.9900000000000002