Shane Harvey
Shane Harvey
Updated to only change unittest (and the DocTestCase subclass of TestCase). Ready for another look.
> there are definitely places where Callable[..., object] -> Callable[..., Any] can result in false negatives. This may have been true before but I don't think it is anymore now...
> regress our stubs Can you explain how this would be a regression? IIUC Any and object are functionally identical here.
No worries. Thanks for the quick responses!
decode() is [defined here](https://github.com/mongodb/mongo-python-driver/blob/2a24de94f220b7b90321f0e5ab90a4a91dc60f94/bson/__init__.py#L1010-L1012): ```python def decode( data: _ReadableBuffer, codec_options: "Optional[CodecOptions[_DocumentType]]" = None ) -> _DocumentType: ... ``` and _DocumentType is [defined here](https://github.com/mongodb/mongo-python-driver/blob/474420b2e5b8318c58f596a9f5b4d3ed6a871ccd/bson/codec_options.pyi#L55): ```python class CodecOptions(Tuple, Generic[_DocumentType]): document_class: Type[_DocumentType] tz_aware:...
Here's the smallest repro I could get: ```python import unittest from typing import TypeVar, Any, Mapping, Optional T = TypeVar("T", bound=Mapping[str, Any]) def raises(opts: Optional[T] = None) -> T: if...
> Is there a risk that this mypy bug could hit users for any of the other functions that were changed in https://github.com/python/typeshed/pull/7012? Or are we good to leave this...
> If you're OK with it, I might just rewrite it now to use with_transaction. Really the "rewrite" will be in the tests to adhere to the new contract. This...
PyMongo _does_ have a context manager API but the drawback is that is not possible to have retries with such an API [as mentioned above](https://github.com/MongoEngine/mongoengine/pull/2569#pullrequestreview-1548484351). Retries are not possible because...
> I don't think it would be a sane default to just retry a chain of calls I understand this concern but I don't think this is as big of...