Returns a dictionary consisting of the keys in the argument dictionaries. If they share a key, the value from the last argument is used. >>> dictadd({1: 0, 2: 0}, {2: 1, 3: 1}) {1: 0, 2: 1, 3: 1}
(*dicts)
| 816 | |
| 817 | |
| 818 | def dictadd(*dicts): |
| 819 | """ |
| 820 | Returns a dictionary consisting of the keys in the argument dictionaries. |
| 821 | If they share a key, the value from the last argument is used. |
| 822 | |
| 823 | >>> dictadd({1: 0, 2: 0}, {2: 1, 3: 1}) |
| 824 | {1: 0, 2: 1, 3: 1} |
| 825 | """ |
| 826 | result = {} |
| 827 | for dct in dicts: |
| 828 | result.update(dct) |
| 829 | return result |
| 830 | |
| 831 | |
| 832 | def requeue(queue, index=-1): |