absolute beginners question about API documentation

M

Markus Joschko

Hi all,
I' new to python programming but a longtime java programmer.
Is there an API documentation like the javadoc API from java?

I'm want to know all methods I can use on dictionaries. Where can I get an
overview about these?
I looked on python.org but haven't found such an overview.

Thanks,
Markus
 
D

Dave Kuhlman

Markus said:
Hi all,
I' new to python programming but a longtime java programmer.
Is there an API documentation like the javadoc API from java?

I'm want to know all methods I can use on dictionaries. Where can
I get an overview about these?
I looked on python.org but haven't found such an overview.

If you are asking about the *Python* API, then look here:

http://www.python.org/doc/current/lib/typesmapping.html

If you are asking about the C API (which is less likely but
possible), then look here:

http://www.python.org/doc/current/api/dictObjects.html

Hope this helps.

- Dave
 
B

Behrang Dadsetan

Dave said:
If you are asking about the *Python* API, then look here:
http://www.python.org/doc/current/lib/typesmapping.html
If you are asking about the C API (which is less likely but
possible), then look here:

http://www.python.org/doc/current/api/dictObjects.html

Maybe one should add for better comprehension that dictionaries in
python are builtin types.

So when you look for them in documentation, you should look into the
basics and not for some Standard Library class as you would in the Java
world.

Hope it helps,
Ben.
 
A

Alan Kennedy

Markus said:
Thanks. That's it. I hadn't suspect it there.

And don't forget the interactive help available on most objects,
through the use of the dir() and help() functions, e.g.

Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__',
'__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__',
'__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
'__lt__', '__ne__', '__new__', '__reduce__', '__repr__',
'__setattr__',
'__setitem__', '__str__', 'clear', 'copy', 'get', 'has_key', 'items',
'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem',
'setdefault',
'update', 'values']Help on built-in function keys:

keys(...)
D.keys() -> list of D's keys
Help on built-in function has_key:

has_key(...)
D.has_key(k) -> 1 if D has a key k, else 0

HTH,
 
A

Alan Kennedy

I

Ian Bicking

Hi all,
I' new to python programming but a longtime java programmer.
Is there an API documentation like the javadoc API from java?

http://python.org/doc/ , of course.
I'm want to know all methods I can use on dictionaries. Where can I get an
overview about these?

You want to look at the Library Reference, in the built-in type section
(mapping types). You can also try:
['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__',
'__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__',
'__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__',
'__lt__', '__ne__', '__new__', '__reduce__', '__repr__', '__setattr__',
'__setitem__', '__str__', 'clear', 'copy', 'get', 'has_key', 'items',
'iteritems', 'iterkeys', 'itervalues', 'keys', 'popitem', 'setdefault',
'update', 'values']Help on built-in function update:

update(...)
D.update(E) -> None. Update D from E: for k in E.keys(): D[k] =
E[k]
 
C

Cousin Stanley

| Hi all,
| I' new to python programming but a longtime java programmer.
| Is there an API documentation like the javadoc API from java?
| ...

Markus ...

I find the pydoc module handy for helping
to find Python information ...

The following command line starts pydoc
with a small GUI as a Python documentation server
with search and browse options ...

python YourPythonPath/Lib/pydoc.py -g

The browse option is useful because it also lists
docs for any installed site-packages ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top