Finding Python help...

Cameron Laird claird at lairds.com
Mon Mar 31 09:31:52 EST 2003


In article <pan.2003.03.31.12.31.42.268330.12686 at metaslash.com>,
Neal Norwitz  <neal at metaslash.com> wrote:
>On Mon, 31 Mar 2003 07:14:07 -0500, Steve Cassidy wrote:
			.
			.
			.
>> Another problem, how do I find out what methods are defined on a type
>> like list? Again,  I end up in the tutorial trying to find relevant
>> docs.
>
>>>> dir([])
>
>Don't forget about docstrings too:
>
>>>> print [].__doc__
>list() -> new list
>list(sequence) -> new list initialized from sequence's items
>>>> print [].append.__doc__
>L.append(object) -- append object to end
>
>
>Neal

I thought of most interest to Steve would be
  >>> dir(list)
  ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
   '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__',
   '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__',
   '__imul__', '__init__', '__le__', '__len__', '__lt__', '__mul__',
   '__ne__', '__new__', '__reduce__', '__repr__', '__rmul__',
   '__setattr__', '__setitem__', '__setslice__', '__str__', 'append',
   'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list