Re: List index method for complex list item types?



On Fri, 30 Dec 2005 18:56:47 -0800, techiepundit wrote:

> Mike,
>
> I'm trying to figure out dictionaries using the documentation. Clicking
> on "dictionary type" takes me to "2.3.8 Mapping Types -- classdict". Is
> that the documentation for the dictionary type? If so, I do not see an
> "append" or "add" or "insert" method defined in the list of methods on
> that page.

No you don't. Why do you think dicts need one?

> Here's what they list:
>
> Operation Result Notes
> len(a) the number of items in a
> a[k] the item of a with key k (1)
> a[k] = v set a[k] to v

x = a[k] # get the value in dict a with key k
a[k] = x # set the value in dict a with key k

What more do you need?



--
Steven.

.



Relevant Pages

  • pydoc - suppressing builtins?
    ... Is it possible to persuade pydoc not to include documentation for ... methods inherited from built-in classes? ... inherit from dict, and don't really need documentation thousands of ...
    (comp.lang.python)
  • Re: __dict__ for instances?
    ... Citing the gtk.glade.XML.signal_autoconnect documentation: def signal_autoconnect ... dict: a mapping or an instance ...
    (comp.lang.python)
  • Re: Help and optimization hints, anyone?
    ... def __init__: ... dict is the builtin name for the dictionary type: ... > this migrated from a regular dict which i had to drop because its ...
    (comp.lang.python)