Commit Graph

17 Commits

Author SHA1 Message Date
Steven Silvester
83ab612aa1
PYTHON-3932 Support mypy --strict testing in bson package (#1362) 2023-08-29 13:49:11 -05:00
Iris
c1d33831e8
PYTHON-3907 add --disallow-untyped-defs for mypy (#1351) 2023-08-10 11:08:36 -07:00
Shane Harvey
0092b0af79
PYTHON-2504 Run pyupgrade 3.4.0 and ruff 0.0.265 (#1196)
pyupgrade --py37-plus bson/*.py pymongo/*.py gridfs/*.py test/*.py tools/*.py test/*/*.py
ruff --fix-only --select ALL --fixable ALL --target-version py37 --line-length=100 --unfixable COM812,D400,D415,ERA001,RUF100,SIM108,D211,D212,SIM105,SIM,PT,ANN204,EM bson/*.py pymongo/*.py gridfs/*.py test/*.py test/*/*.py
2023-05-11 15:27:17 -07:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
52ed5a4135
PYTHON-3052 Add Typings to PyMongo Itself (#829) 2022-01-13 16:09:48 -06:00
Julius Park
c38085269b
PYTHON-1337 Add __slots__ to commonly used bson classes (#739) 2021-09-24 13:54:40 -07:00
Shane Harvey
69c69a6bfb
PYTHON-2862 Remove versionchanged info for PyMongo <3.0 (#709) 2021-08-19 10:39:26 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Anthony Sottile
41be71f09f Trim trailing whitespace 2017-08-31 22:26:39 -07:00
Luke Lovett
3321b66d34 PYTHON-977 - Fix __hash__ method on BSON types that inherit from Python builtin types.
In Python 2, objects automatically inherit the __hash__ of their parent
class. In Python 3, objects that override __eq__ do not automatically inherit
__hash__, so these objects were not hashable under Python 3.  Additionally,
mutable BSON types and types that overide __eq__ but did not explicitly define
__hash__ had broken __hash__ methods under Python 2.  This commit unifies the
hashing behavior between Python versions and fixes the __hash__ methods such
that two BSON objects hash the same only if they are equal.

N.B.: bson.code.Code and bson.regex.Regex are no longer hashable under Python 2
because they are mutable.
2015-09-04 14:45:24 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
A. Jesse Jiryu Davis
c972894953 Implement rich comparison operators for MinKey and MaxKey, PYTHON-604. 2013-12-04 20:38:23 -05:00
Bernie Hackett
ef251aefb1 Fix some _cbson decoder issues on armel PYTHON-313 2013-10-15 11:37:13 -07:00
behackett
2483775f0b Silence C extension RuntimeWarning PYTHON-569
When encoding a document in C while running in a python sub interpreter
(e.g. mod_wsgi spawning sub interpreters) PyMongo would often have
to reload its cache of pure python types - ObjectId, Timestamp,
UUID, etc. - raising RuntimeWarning in the process. The reason this was
necessary is described in the mod_wsgi documentation here:

https://code.google.com/p/modwsgi/wiki/ApplicationIssues#Multiple_Python_Sub_Interpreters

With workarounds documented here:

http://api.mongodb.org/python/2.6.2/faq.html#does-pymongo-work-with-mod-wsgi

With this commit PyMongo will no longer use cached pure python types
when running in a sub interpreter. Instead it will look up pure python
types as needed (primarily when decoding BSON). This eliminates the
problem described in the mod_wsgi docs and eliminates the need for the
Runtime warning.
2013-09-16 17:24:37 -04:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00
Mike Dirolf
9c182809f3 Create a separate bson package PYTHON-60
Many of the pymongo modules have been moved into the bson
package. Aliases for those modules have been added to the pymongo
package, without deprecation warnings for now. Application developers
should begin to use the bson namespace, as deprecation of moved
modules will probably begin in the next release.
2010-09-14 13:52:50 -04:00