From 7bf2677f736dda7fae7b21472e878d8b773b45ec Mon Sep 17 00:00:00 2001 From: Christopher Dignam Date: Thu, 3 Jun 2021 16:47:43 -0400 Subject: [PATCH] cut: `__getitem__` and `__setitem__` methods To improve type safety we can remove these methods. --- pyproject.toml | 2 +- typings/mongoengine/document.pyi | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 04ddff9..4644f4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mongo-types" -version = "0.12.1" +version = "0.13.0" description = "Type stubs for mongoengine w/ basic support for bson and pymongo" repository = "https://github.com/sbdchd/mongo-types" readme = "README.md" diff --git a/typings/mongoengine/document.pyi b/typings/mongoengine/document.pyi index 3e75e90..43d2f70 100644 --- a/typings/mongoengine/document.pyi +++ b/typings/mongoengine/document.pyi @@ -60,9 +60,6 @@ class Document(BaseDocument): from: https://github.com/python/peps/commit/ada7d3566e26edf5381d1339b61e48a82c51c566#diff-da7d638a3d189515209a80943cdc8eaf196b75d20ccc0d6a796393c025d1f975R1169 """ ... - # TODO(sbdchd): later we can remove these to get more type checking and better autocomplete - def __getitem__(self, key: str) -> Any: ... - def __setitem__(self, key: str, value: Any) -> None: ... class EmbeddedDocument(BaseDocument): _fields: Dict[str, Any] @@ -70,7 +67,6 @@ class EmbeddedDocument(BaseDocument): def __new__(cls, *args: Any, **kwargs: Any) -> EmbeddedDocument: ... def save(self) -> None: ... def __contains__(self, key: str) -> bool: ... - def __getitem__(self, key: str) -> Any: ... class DynamicDocument(Document): def __getattr__(self, key: str) -> Any: ...