We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
attrs parameter to Item.__init__ and table.new_item don't work as documented
In dynamodb/table.py, `new_item` is documented to take an `attrs` parameter which will be used to populate the new item.

However, this doesn't work:
`
    In [3]: item = table.new_item('key', attrs={"a":"test"})
    In [4]: item.save()
    Out[4]: {'ConsumedCapacityUnits': 1.0}
    In [5]: read = table.get_item('key')
    In [6]: print read
    {'key': 'key'}
`

The bug is in item.py in `__init__` - `self._updates` is `None` until after the `attrs` dictionary is copied - but `__setitem__` doesn't update the `_updates` dictionary if it is None.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `boto/dynamodb/item.py`
Content:
```
1 # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
2 # Copyright (c) 2012 Amazon.com, Inc. or its affiliates.  All Rights Reserved
3 #
4 # Permission is hereby granted, free of charge, to any person obtaining a
5 # copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish, dis-
8 # tribute, sublicense, and/or sell copies of the Software, and to permit
9 # persons to whom the Software is furnished to do so, subject to the fol-
10 # lowing conditions:
11 #
12 # The above copyright notice and this permission notice shall be included
13 # in all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
17 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
18 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 # IN THE SOFTWARE.
22 #
23 
24 from boto.dynamodb.exceptions import DynamoDBItemError
25 
26 
27 class Item(dict):
28     """
29     An item in Amazon DynamoDB.
30 
31     :ivar hash_key: The HashKey of this item.
32     :ivar range_key: The RangeKey of this item or None if no RangeKey
33         is defined.
34     :ivar hash_key_name: The name of the HashKey associated with this item.
35     :ivar range_key_name: The name of the RangeKey associated with this item.
36     :ivar table: The Table this item belongs to.
37     """
38     
39     def __init__(self, table, hash_key=None, range_key=None, attrs=None):
40         self.table = table
41         self._updates = None
42         self._hash_key_name = self.table.schema.hash_key_name
43         self._range_key_name = self.table.schema.range_key_name
44         if attrs == None:
45             attrs = {}
46         if hash_key == None:
47             hash_key = attrs.get(self._hash_key_name, None)
48         self[self._hash_key_name] = hash_key
49         if self._range_key_name:
50             if range_key == None:
51                 range_key = attrs.get(self._range_key_name, None)
52             self[self._range_key_name] = range_key
53         for key, value in attrs.items():
54             if key != self._hash_key_name and key != self._range_key_name:
55                 self[key] = value
56         self.consumed_units = 0
57         self._updates = {}
58 
59     @property
60     def hash_key(self):
61         return self[self._hash_key_name]
62 
63     @property
64     def range_key(self):
65         return self.get(self._range_key_name)
66 
67     @property
68     def hash_key_name(self):
69         return self._hash_key_name
70 
71     @property
72     def range_key_name(self):
73         return self._range_key_name
74 
75     def add_attribute(self, attr_name, attr_value):
76         """
77         Queue the addition of an attribute to an item in DynamoDB.
78         This will eventually result in an UpdateItem request being issued
79         with an update action of ADD when the save method is called.
80 
81         :type attr_name: str
82         :param attr_name: Name of the attribute you want to alter.
83 
84         :type attr_value: int|long|float|set
85         :param attr_value: Value which is to be added to the attribute.
86         """
87         self._updates[attr_name] = ("ADD", attr_value)
88 
89     def delete_attribute(self, attr_name, attr_value=None):
90         """
91         Queue the deletion of an attribute from an item in DynamoDB.
92         This call will result in a UpdateItem request being issued
93         with update action of DELETE when the save method is called.
94 
95         :type attr_name: str
96         :param attr_name: Name of the attribute you want to alter.
97 
98         :type attr_value: set
99         :param attr_value: A set of values to be removed from the attribute.
100             This parameter is optional. If None, the whole attribute is
101             removed from the item.
102         """
103         self._updates[attr_name] = ("DELETE", attr_value)
104 
105     def put_attribute(self, attr_name, attr_value):
106         """
107         Queue the putting of an attribute to an item in DynamoDB.
108         This call will result in an UpdateItem request being issued
109         with the update action of PUT when the save method is called.
110 
111         :type attr_name: str
112         :param attr_name: Name of the attribute you want to alter.
113 
114         :type attr_value: int|long|float|str|set
115         :param attr_value: New value of the attribute.
116         """
117         self._updates[attr_name] = ("PUT", attr_value)
118 
119     def save(self, expected_value=None, return_values=None):
120         """
121         Commits pending updates to Amazon DynamoDB.
122 
123         :type expected_value: dict
124         :param expected_value: A dictionary of name/value pairs that
125             you expect.  This dictionary should have name/value pairs
126             where the name is the name of the attribute and the value is
127             either the value you are expecting or False if you expect
128             the attribute not to exist.
129 
130         :type return_values: str
131         :param return_values: Controls the return of attribute name/value pairs
132             before they were updated. Possible values are: None, 'ALL_OLD',
133             'UPDATED_OLD', 'ALL_NEW' or 'UPDATED_NEW'. If 'ALL_OLD' is
134             specified and the item is overwritten, the content of the old item
135             is returned. If 'ALL_NEW' is specified, then all the attributes of
136             the new version of the item are returned. If 'UPDATED_NEW' is
137             specified, the new versions of only the updated attributes are
138             returned.
139         """
140         return self.table.layer2.update_item(self, expected_value,
141                                              return_values)
142 
143     def delete(self, expected_value=None, return_values=None):
144         """
145         Delete the item from DynamoDB.
146 
147         :type expected_value: dict
148         :param expected_value: A dictionary of name/value pairs that
149             you expect.  This dictionary should have name/value pairs
150             where the name is the name of the attribute and the value
151             is either the value you are expecting or False if you expect
152             the attribute not to exist.
153 
154         :type return_values: str
155         :param return_values: Controls the return of attribute
156             name-value pairs before then were changed.  Possible
157             values are: None or 'ALL_OLD'. If 'ALL_OLD' is
158             specified and the item is overwritten, the content
159             of the old item is returned.
160         """
161         return self.table.layer2.delete_item(self, expected_value,
162                                              return_values)
163 
164     def put(self, expected_value=None, return_values=None):
165         """
166         Store a new item or completely replace an existing item
167         in Amazon DynamoDB.
168 
169         :type expected_value: dict
170         :param expected_value: A dictionary of name/value pairs that
171             you expect.  This dictionary should have name/value pairs
172             where the name is the name of the attribute and the value
173             is either the value you are expecting or False if you expect
174             the attribute not to exist.
175 
176         :type return_values: str
177         :param return_values: Controls the return of attribute
178             name-value pairs before then were changed.  Possible
179             values are: None or 'ALL_OLD'. If 'ALL_OLD' is
180             specified and the item is overwritten, the content
181             of the old item is returned.
182         """
183         return self.table.layer2.put_item(self, expected_value, return_values)
184 
185     def __setitem__(self, key, value):
186         """Overrwrite the setter to instead update the _updates
187         method so this can act like a normal dict"""
188         if self._updates is not None:
189             self.put_attribute(key, value)
190         dict.__setitem__(self, key, value)
191 
192     def __delitem__(self, key):
193         """Remove this key from the items"""
194         if self._updates is not None:
195             self.delete_attribute(key)
196         dict.__delitem__(self, key)
197 
198     # Allow this item to still be pickled
199     def __getstate__(self):
200         return self.__dict__
201     def __setstate__(self, d):
202         self.__dict__.update(d)
203
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/boto/dynamodb/item.py b/boto/dynamodb/item.py
--- a/boto/dynamodb/item.py
+++ b/boto/dynamodb/item.py
@@ -50,11 +50,11 @@
             if range_key == None:
                 range_key = attrs.get(self._range_key_name, None)
             self[self._range_key_name] = range_key
+        self._updates = {}
         for key, value in attrs.items():
             if key != self._hash_key_name and key != self._range_key_name:
                 self[key] = value
         self.consumed_units = 0
-        self._updates = {}
 
     @property
     def hash_key(self):

{"golden_diff": "diff --git a/boto/dynamodb/item.py b/boto/dynamodb/item.py\n--- a/boto/dynamodb/item.py\n+++ b/boto/dynamodb/item.py\n@@ -50,11 +50,11 @@\n             if range_key == None:\n                 range_key = attrs.get(self._range_key_name, None)\n             self[self._range_key_name] = range_key\n+        self._updates = {}\n         for key, value in attrs.items():\n             if key != self._hash_key_name and key != self._range_key_name:\n                 self[key] = value\n         self.consumed_units = 0\n-        self._updates = {}\n \n     @property\n     def hash_key(self):\n", "issue": "attrs parameter to Item.__init__ and table.new_item don't work as documented\nIn dynamodb/table.py, `new_item` is documented to take an `attrs` parameter which will be used to populate the new item.\n\nHowever, this doesn't work:\n`\n    In [3]: item = table.new_item('key', attrs={\"a\":\"test\"})\n    In [4]: item.save()\n    Out[4]: {'ConsumedCapacityUnits': 1.0}\n    In [5]: read = table.get_item('key')\n    In [6]: print read\n    {'key': 'key'}\n`\n\nThe bug is in item.py in `__init__` - `self._updates` is `None` until after the `attrs` dictionary is copied - but `__setitem__` doesn't update the `_updates` dictionary if it is None.\n\n", "before_files": [{"content": "# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/\n# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.  All Rights Reserved\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish, dis-\n# tribute, sublicense, and/or sell copies of the Software, and to permit\n# persons to whom the Software is furnished to do so, subject to the fol-\n# lowing conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-\n# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\n# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n# IN THE SOFTWARE.\n#\n\nfrom boto.dynamodb.exceptions import DynamoDBItemError\n\n\nclass Item(dict):\n    \"\"\"\n    An item in Amazon DynamoDB.\n\n    :ivar hash_key: The HashKey of this item.\n    :ivar range_key: The RangeKey of this item or None if no RangeKey\n        is defined.\n    :ivar hash_key_name: The name of the HashKey associated with this item.\n    :ivar range_key_name: The name of the RangeKey associated with this item.\n    :ivar table: The Table this item belongs to.\n    \"\"\"\n    \n    def __init__(self, table, hash_key=None, range_key=None, attrs=None):\n        self.table = table\n        self._updates = None\n        self._hash_key_name = self.table.schema.hash_key_name\n        self._range_key_name = self.table.schema.range_key_name\n        if attrs == None:\n            attrs = {}\n        if hash_key == None:\n            hash_key = attrs.get(self._hash_key_name, None)\n        self[self._hash_key_name] = hash_key\n        if self._range_key_name:\n            if range_key == None:\n                range_key = attrs.get(self._range_key_name, None)\n            self[self._range_key_name] = range_key\n        for key, value in attrs.items():\n            if key != self._hash_key_name and key != self._range_key_name:\n                self[key] = value\n        self.consumed_units = 0\n        self._updates = {}\n\n    @property\n    def hash_key(self):\n        return self[self._hash_key_name]\n\n    @property\n    def range_key(self):\n        return self.get(self._range_key_name)\n\n    @property\n    def hash_key_name(self):\n        return self._hash_key_name\n\n    @property\n    def range_key_name(self):\n        return self._range_key_name\n\n    def add_attribute(self, attr_name, attr_value):\n        \"\"\"\n        Queue the addition of an attribute to an item in DynamoDB.\n        This will eventually result in an UpdateItem request being issued\n        with an update action of ADD when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: int|long|float|set\n        :param attr_value: Value which is to be added to the attribute.\n        \"\"\"\n        self._updates[attr_name] = (\"ADD\", attr_value)\n\n    def delete_attribute(self, attr_name, attr_value=None):\n        \"\"\"\n        Queue the deletion of an attribute from an item in DynamoDB.\n        This call will result in a UpdateItem request being issued\n        with update action of DELETE when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: set\n        :param attr_value: A set of values to be removed from the attribute.\n            This parameter is optional. If None, the whole attribute is\n            removed from the item.\n        \"\"\"\n        self._updates[attr_name] = (\"DELETE\", attr_value)\n\n    def put_attribute(self, attr_name, attr_value):\n        \"\"\"\n        Queue the putting of an attribute to an item in DynamoDB.\n        This call will result in an UpdateItem request being issued\n        with the update action of PUT when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: int|long|float|str|set\n        :param attr_value: New value of the attribute.\n        \"\"\"\n        self._updates[attr_name] = (\"PUT\", attr_value)\n\n    def save(self, expected_value=None, return_values=None):\n        \"\"\"\n        Commits pending updates to Amazon DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value is\n            either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute name/value pairs\n            before they were updated. Possible values are: None, 'ALL_OLD',\n            'UPDATED_OLD', 'ALL_NEW' or 'UPDATED_NEW'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content of the old item\n            is returned. If 'ALL_NEW' is specified, then all the attributes of\n            the new version of the item are returned. If 'UPDATED_NEW' is\n            specified, the new versions of only the updated attributes are\n            returned.\n        \"\"\"\n        return self.table.layer2.update_item(self, expected_value,\n                                             return_values)\n\n    def delete(self, expected_value=None, return_values=None):\n        \"\"\"\n        Delete the item from DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value\n            is either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute\n            name-value pairs before then were changed.  Possible\n            values are: None or 'ALL_OLD'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content\n            of the old item is returned.\n        \"\"\"\n        return self.table.layer2.delete_item(self, expected_value,\n                                             return_values)\n\n    def put(self, expected_value=None, return_values=None):\n        \"\"\"\n        Store a new item or completely replace an existing item\n        in Amazon DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value\n            is either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute\n            name-value pairs before then were changed.  Possible\n            values are: None or 'ALL_OLD'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content\n            of the old item is returned.\n        \"\"\"\n        return self.table.layer2.put_item(self, expected_value, return_values)\n\n    def __setitem__(self, key, value):\n        \"\"\"Overrwrite the setter to instead update the _updates\n        method so this can act like a normal dict\"\"\"\n        if self._updates is not None:\n            self.put_attribute(key, value)\n        dict.__setitem__(self, key, value)\n\n    def __delitem__(self, key):\n        \"\"\"Remove this key from the items\"\"\"\n        if self._updates is not None:\n            self.delete_attribute(key)\n        dict.__delitem__(self, key)\n\n    # Allow this item to still be pickled\n    def __getstate__(self):\n        return self.__dict__\n    def __setstate__(self, d):\n        self.__dict__.update(d)\n", "path": "boto/dynamodb/item.py"}], "after_files": [{"content": "# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/\n# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.  All Rights Reserved\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish, dis-\n# tribute, sublicense, and/or sell copies of the Software, and to permit\n# persons to whom the Software is furnished to do so, subject to the fol-\n# lowing conditions:\n#\n# The above copyright notice and this permission notice shall be included\n# in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-\n# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT\n# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n# IN THE SOFTWARE.\n#\n\nfrom boto.dynamodb.exceptions import DynamoDBItemError\n\n\nclass Item(dict):\n    \"\"\"\n    An item in Amazon DynamoDB.\n\n    :ivar hash_key: The HashKey of this item.\n    :ivar range_key: The RangeKey of this item or None if no RangeKey\n        is defined.\n    :ivar hash_key_name: The name of the HashKey associated with this item.\n    :ivar range_key_name: The name of the RangeKey associated with this item.\n    :ivar table: The Table this item belongs to.\n    \"\"\"\n    \n    def __init__(self, table, hash_key=None, range_key=None, attrs=None):\n        self.table = table\n        self._updates = None\n        self._hash_key_name = self.table.schema.hash_key_name\n        self._range_key_name = self.table.schema.range_key_name\n        if attrs == None:\n            attrs = {}\n        if hash_key == None:\n            hash_key = attrs.get(self._hash_key_name, None)\n        self[self._hash_key_name] = hash_key\n        if self._range_key_name:\n            if range_key == None:\n                range_key = attrs.get(self._range_key_name, None)\n            self[self._range_key_name] = range_key\n        self._updates = {}\n        for key, value in attrs.items():\n            if key != self._hash_key_name and key != self._range_key_name:\n                self[key] = value\n        self.consumed_units = 0\n\n    @property\n    def hash_key(self):\n        return self[self._hash_key_name]\n\n    @property\n    def range_key(self):\n        return self.get(self._range_key_name)\n\n    @property\n    def hash_key_name(self):\n        return self._hash_key_name\n\n    @property\n    def range_key_name(self):\n        return self._range_key_name\n\n    def add_attribute(self, attr_name, attr_value):\n        \"\"\"\n        Queue the addition of an attribute to an item in DynamoDB.\n        This will eventually result in an UpdateItem request being issued\n        with an update action of ADD when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: int|long|float|set\n        :param attr_value: Value which is to be added to the attribute.\n        \"\"\"\n        self._updates[attr_name] = (\"ADD\", attr_value)\n\n    def delete_attribute(self, attr_name, attr_value=None):\n        \"\"\"\n        Queue the deletion of an attribute from an item in DynamoDB.\n        This call will result in a UpdateItem request being issued\n        with update action of DELETE when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: set\n        :param attr_value: A set of values to be removed from the attribute.\n            This parameter is optional. If None, the whole attribute is\n            removed from the item.\n        \"\"\"\n        self._updates[attr_name] = (\"DELETE\", attr_value)\n\n    def put_attribute(self, attr_name, attr_value):\n        \"\"\"\n        Queue the putting of an attribute to an item in DynamoDB.\n        This call will result in an UpdateItem request being issued\n        with the update action of PUT when the save method is called.\n\n        :type attr_name: str\n        :param attr_name: Name of the attribute you want to alter.\n\n        :type attr_value: int|long|float|str|set\n        :param attr_value: New value of the attribute.\n        \"\"\"\n        self._updates[attr_name] = (\"PUT\", attr_value)\n\n    def save(self, expected_value=None, return_values=None):\n        \"\"\"\n        Commits pending updates to Amazon DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value is\n            either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute name/value pairs\n            before they were updated. Possible values are: None, 'ALL_OLD',\n            'UPDATED_OLD', 'ALL_NEW' or 'UPDATED_NEW'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content of the old item\n            is returned. If 'ALL_NEW' is specified, then all the attributes of\n            the new version of the item are returned. If 'UPDATED_NEW' is\n            specified, the new versions of only the updated attributes are\n            returned.\n        \"\"\"\n        return self.table.layer2.update_item(self, expected_value,\n                                             return_values)\n\n    def delete(self, expected_value=None, return_values=None):\n        \"\"\"\n        Delete the item from DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value\n            is either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute\n            name-value pairs before then were changed.  Possible\n            values are: None or 'ALL_OLD'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content\n            of the old item is returned.\n        \"\"\"\n        return self.table.layer2.delete_item(self, expected_value,\n                                             return_values)\n\n    def put(self, expected_value=None, return_values=None):\n        \"\"\"\n        Store a new item or completely replace an existing item\n        in Amazon DynamoDB.\n\n        :type expected_value: dict\n        :param expected_value: A dictionary of name/value pairs that\n            you expect.  This dictionary should have name/value pairs\n            where the name is the name of the attribute and the value\n            is either the value you are expecting or False if you expect\n            the attribute not to exist.\n\n        :type return_values: str\n        :param return_values: Controls the return of attribute\n            name-value pairs before then were changed.  Possible\n            values are: None or 'ALL_OLD'. If 'ALL_OLD' is\n            specified and the item is overwritten, the content\n            of the old item is returned.\n        \"\"\"\n        return self.table.layer2.put_item(self, expected_value, return_values)\n\n    def __setitem__(self, key, value):\n        \"\"\"Overrwrite the setter to instead update the _updates\n        method so this can act like a normal dict\"\"\"\n        if self._updates is not None:\n            self.put_attribute(key, value)\n        dict.__setitem__(self, key, value)\n\n    def __delitem__(self, key):\n        \"\"\"Remove this key from the items\"\"\"\n        if self._updates is not None:\n            self.delete_attribute(key)\n        dict.__delitem__(self, key)\n\n    # Allow this item to still be pickled\n    def __getstate__(self):\n        return self.__dict__\n    def __setstate__(self, d):\n        self.__dict__.update(d)\n", "path": "boto/dynamodb/item.py"}]}