Mercurial > repos > devteam > flanking_features
comparison utils/odict.py @ 1:850c05b9af00 draft
planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author | devteam |
---|---|
date | Tue, 13 Oct 2015 12:50:14 -0400 |
parents | e928e029f6eb |
children |
comparison
equal
deleted
inserted
replaced
0:e928e029f6eb | 1:850c05b9af00 |
---|---|
1 """ | 1 """ |
2 Ordered dictionary implementation. | 2 Ordered dictionary implementation. |
3 """ | 3 """ |
4 | 4 |
5 from UserDict import UserDict | 5 from UserDict import UserDict |
6 | |
6 | 7 |
7 class odict(UserDict): | 8 class odict(UserDict): |
8 """ | 9 """ |
9 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 | 10 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 |
10 | 11 |
11 This dictionary class extends UserDict to record the order in which items are | 12 This dictionary class extends UserDict to record the order in which items are |
12 added. Calling keys(), values(), items(), etc. will return results in this | 13 added. Calling keys(), values(), items(), etc. will return results in this |
13 order. | 14 order. |
14 """ | 15 """ |
15 def __init__( self, dict = None ): | 16 def __init__( self, dict=None ): |
16 self._keys = [] | 17 self._keys = [] |
17 UserDict.__init__( self, dict ) | 18 UserDict.__init__( self, dict ) |
18 | 19 |
19 def __delitem__( self, key ): | 20 def __delitem__( self, key ): |
20 UserDict.__delitem__( self, key ) | 21 UserDict.__delitem__( self, key ) |