Enable proxies (Self/Parent) for specifying ports.
Significant revamp of Port code.
Some cleanup of SimObject code too, particularly to
make the SimObject and MetaSimObject implementations of
__setattr__ more consistent.
Unproxy code split out of print_ini().
src/python/m5/multidict.py:
Make get() return None by default, to match semantics
of built-in dictionary objects.
--HG--
extra : convert_revision : db73b6cdd004a82a08b2402afd1e16544cb902a4
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
__all__ = [ 'multidict' ]
|
||||
|
||||
class multidict(object):
|
||||
__nodefault = object()
|
||||
def __init__(self, parent = {}, **kwargs):
|
||||
self.local = dict(**kwargs)
|
||||
self.parent = parent
|
||||
@@ -102,14 +101,11 @@ class multidict(object):
|
||||
def values(self):
|
||||
return [ value for key,value in self.next() ]
|
||||
|
||||
def get(self, key, default=__nodefault):
|
||||
def get(self, key, default=None):
|
||||
try:
|
||||
return self[key]
|
||||
except KeyError, e:
|
||||
if default != self.__nodefault:
|
||||
return default
|
||||
else:
|
||||
raise KeyError, e
|
||||
return default
|
||||
|
||||
def setdefault(self, key, default):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user