From 1564770456ab2aa062844838afde5aea51dd2ea9 Mon Sep 17 00:00:00 2001 From: Ilya Konstantinov Date: Mon, 17 Dec 2018 08:06:42 -0800 Subject: [PATCH] Add pynamodb.models.Model.get_attribute and narrow down the type (#2689) --- third_party/2and3/pynamodb/models.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third_party/2and3/pynamodb/models.pyi b/third_party/2and3/pynamodb/models.pyi index ee728d41e..5943a58d6 100644 --- a/third_party/2and3/pynamodb/models.pyi +++ b/third_party/2and3/pynamodb/models.pyi @@ -1,3 +1,4 @@ +from .attributes import Attribute from .exceptions import DoesNotExist as DoesNotExist from typing import Any, Dict, Generic, Iterable, Iterator, List, Optional, Sequence, Tuple, Type, TypeVar, Text, Union @@ -85,7 +86,9 @@ class Model(metaclass=MetaModel): @classmethod def get_throttle(cls): ... @classmethod - def _get_attributes(cls) -> Dict[str, Any]: ... + def get_attributes(cls) -> Dict[str, Attribute]: ... + @classmethod + def _get_attributes(cls) -> Dict[str, Attribute]: ... class ModelContextManager(Generic[_T]): model: Type[_T]