Skip to content

Commit b16231d

Browse files
authored
Fix documentation for MapAttribute (#1218)
default must be immutable https://pynamodb.readthedocs.io/en/latest/api.html\#pynamodb.attributes.Attribute Co-authored-by: Nico Tonnhofer <nico.tonnhofer@deutschebahn.com>
1 parent d61d906 commit b16231d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pynamodb/attributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ class MapAttribute(Attribute[Mapping[_KT, _VT]], AttributeContainer, metaclass=M
929929
For example, below we define "MyModel" which contains a MapAttribute "my_map":
930930
931931
class MyModel(Model):
932-
my_map = MapAttribute(attr_name="dynamo_name", default={})
932+
my_map = MapAttribute(attr_name="dynamo_name", default=dict)
933933
934934
When instantiated in this manner (as a class attribute of an AttributeContainer class), the MapAttribute
935935
class acts as an instance of the Attribute class. The instance stores data about the attribute (in this

0 commit comments

Comments
 (0)