1 """This module contains single class, to store a sorted list."""
2 # Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 # This program and the accompanying materials are made available under the
5 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 # and is available at http://www.eclipse.org/legal/epl-v10.html
8 __author__ = "Vratko Polak"
9 __copyright__ = "Copyright(c) 2015, Cisco Systems, Inc."
10 __license__ = "Eclipse Public License v1.0"
11 __email__ = "vrpolak@cisco.com"
16 Hashable sorted frozen list implementation stub.
18 Supports only __init__, __repr__ and __hash__ methods.
19 Other list methods are available, but they may break contract.
22 def __init__(self, *args, **kwargs):
23 """Contruct super, sort and compute repr and hash cache values."""
24 sup = super(Hsfl, self)
25 sup.__init__(*args, **kwargs)
27 self.__repr = repr(tuple(self))
28 self.__hash = hash(self.__repr)
31 """Return cached repr string."""
35 """Return cached hash."""