dict :: Class dict
[hide private]
[frames] | no frames]

Class dict

object --+
         |
        dict
Known Subclasses:
nltk_lite.utilities.OrderedDict, nltk_lite.utilities.SortedDict, nltk_lite.utilities.OrderedDict, nltk_lite.semantics.evaluate.CharFun, nltk_lite.semantics.evaluate.Valuation, nltk_lite.semantics.evaluate.Assignment, nltk_lite.contrib.lex.Phon, nltk_lite.contrib.didyoumean.mydict, nltk_lite.semantics.evaluate.Assignment, nltk_lite.semantics.evaluate.CharFun, nltk_lite.semantics.evaluate.Valuation, nltk_lite.semantics.evaluate.CharFun, nltk_lite.semantics.evaluate.Valuation, nltk_lite.semantics.evaluate.Assignment, numpy.core.numerictypes._typedict

dict() -> new empty dictionary.
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs.
dict(seq) -> new dictionary initialized as if via:
    d = {}
    for k, v in seq:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

Instance Methods [hide private]
 
__cmp__(x, y)
cmp(x,y)
 
__contains__(D, k)
Returns: True if D has a key k, else False
 
__delitem__(x, y)
del x[y]
 
__eq__(x, y)
x==y
 
__ge__(x, y)
x>=y
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__getitem__(x, y)
x[y]
 
__gt__(x, y)
x>y
 
__hash__(x)
hash(x)
 
__init__()
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__iter__(x)
iter(x)
 
__le__(x, y)
x<=y
 
__len__(x)
len(x)
 
__lt__(x, y)
x<y
 
__ne__(x, y)
x!=y
 
__new__(T, S, ...)
Returns: a new object with type S, a subtype of T
 
__repr__(x)
repr(x)
 
__setitem__(x, i, y)
x[i]=y
 
clear(D)
Remove all items from D.
 
copy(D)
Returns: a shallow copy of D
 
fromkeys(dict, S, v=...)
v defaults to None.
 
get(D, k, d=...)
d defaults to None.
 
has_key(D, k)
Returns: True if D has a key k, else False
 
items(D)
Returns: list of D's (key, value) pairs, as 2-tuples
 
iteritems(D)
Returns: an iterator over the (key, value) items of D
 
iterkeys(D)
Returns: an iterator over the keys of D
 
itervalues(D)
Returns: an iterator over the values of D
 
keys(D)
Returns: list of D's keys
 
pop(D, k, d=...)
If key is not found, d is returned if given, otherwise KeyError is raised
 
popitem(D)
2-tuple; but raise KeyError if D is empty
 
setdefault(D, k, d=...)
Returns: D.get(k,d), also set D[k]=d if k not in D
 
update(D, E, **F)
Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
 
values(D)
Returns: list of D's values

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__contains__(D, k)
(In operator)

 
Returns:
True if D has a key k, else False

__getattribute__(...)

 

x.__getattribute__('name') <==> x.name

Overrides: object.__getattribute__

__hash__(x)
(Hashing function)

 

hash(x)

Overrides: object.__hash__

__init__()
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns:
new empty dictionary

Overrides: object.__init__

__new__(T, S, ...)

 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__

clear(D)

 

Remove all items from D.

Returns:
None

copy(D)

 
Returns:
a shallow copy of D

fromkeys(dict, S, v=...)

 

v defaults to None.

Returns:
New dict with keys from S and values equal to v

get(D, k, d=...)

 

d defaults to None.

Returns:
D[k] if k in D, else d

has_key(D, k)

 
Returns:
True if D has a key k, else False

items(D)

 
Returns:
list of D's (key, value) pairs, as 2-tuples

iteritems(D)

 
Returns:
an iterator over the (key, value) items of D

iterkeys(D)

 
Returns:
an iterator over the keys of D

itervalues(D)

 
Returns:
an iterator over the values of D

keys(D)

 
Returns:
list of D's keys

pop(D, k, d=...)

 

If key is not found, d is returned if given, otherwise KeyError is raised

Returns:
v, remove specified key and return the corresponding value

popitem(D)

 

2-tuple; but raise KeyError if D is empty

Returns:
(k, v), remove and return some (key, value) pair as a

setdefault(D, k, d=...)

 
Returns:
D.get(k,d), also set D[k]=d if k not in D

update(D, E, **F)

 

Update D from E and F: for k in E: D[k] = E[k] (if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]

Returns:
None

values(D)

 
Returns:
list of D's values