Skip to content

Commit 721a763

Browse files
author
Mike Dirolf
committed
minor: doc, credits
1 parent 8e50781 commit 721a763

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ Thanks to (in no particular order) (if you belong here and are missing please le
7777

7878
- moe at mbox dot bz: turn off nagle
7979
- Michael Stephens (mikejs): seek and tell for read mode GridFile
80+
- Joakim Sernbrant (serbaut): fix decref bug in tuple encoder, hex __repr__ and __str__ for ObjectId

pymongo/objectid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def from_legacy_str(cls, legacy_str):
150150

151151
@property
152152
def binary(self):
153+
"""Get the binary representation of this ObjectId.
154+
"""
153155
return self.__id
154156

155157
def __str__(self):

test/test_objectid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_url(self):
6060
a = ObjectId("123456789012")
6161
self.assertEqual(a.url_encode(), "313233343536373839303132")
6262
self.assertEqual(a, ObjectId.url_decode("313233343536373839303132"))
63+
self.assertEqual(a.url_encode(), str(a))
6364

6465
b = ObjectId()
6566
encoded = b.url_encode()

0 commit comments

Comments
 (0)