473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javadoc style python manual?

Hi there,

I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
But in python, i find it kind of inconvient.

Any advice?

Thx,
Xiong

Sep 8 '06 #1
12 4400
xi*********@gmail.com wrote:
I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
But in python, i find it kind of inconvient.
My advice is to get used to it... the Python docs are not arranged in
the hierarchical fashion because there isn't any real hierarchy to
speak of. Python does not rely heavily on inheritance like Java does.
Instead, it is used in just a few places, more like the C++ standard
library than the Java library.

I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though. I
don't know if there's a solution to that anywhere.

--
Ben Sizer

Sep 8 '06 #2

xi*********@gmail.com wrote:
Hi there,

I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
But in python, i find it kind of inconvient.

Any advice?
With AcitvePython is distributed the htmlhelp version of python
reference
(ActivePython24.chm). It's really convinient to use.

HTH,
Rob

Sep 8 '06 #3
db
On Fri, 08 Sep 2006 01:11:06 -0700, xiong.xu.cn wrote:
Hi there,

I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
But in python, i find it kind of inconvient.

Any advice?

Thx,
Xiong
pydoc is something I know, it is included in the standard distibution

Sep 8 '06 #4
Ben Sizer wrote:
I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though.
http://docs.python.org/lib/modindex.html, pydoc and ipython are more
than enough for me.

Michele Simionato

Sep 8 '06 #5
Michele Simionato wrote:
Ben Sizer wrote:
I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though.

http://docs.python.org/lib/modindex.html, pydoc and ipython are more
than enough for me.
modindex is comprehensive but too 'flat'. Sometimes you want to see all
of one object's methods and properties listed together.

I was unaware of pydoc until this thread; its existence seems to be
buried, somewhat. Looking at pydoc.org (assuming that is a good example
of it in use), it looks more like what the original poster and I might
want, but sadly it's still very inconsistent, with many things
undescribed.

--
Ben Sizer

Sep 8 '06 #6

Ben Sizer wrote:
Michele Simionato wrote:
Ben Sizer wrote:
I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though.
http://docs.python.org/lib/modindex.html, pydoc and ipython are more
than enough for me.

modindex is comprehensive but too 'flat'. Sometimes you want to see all
of one object's methods and properties listed together.

I was unaware of pydoc until this thread; its existence seems to be
buried, somewhat. Looking at pydoc.org (assuming that is a good example
of it in use), it looks more like what the original poster and I might
want, but sadly it's still very inconsistent, with many things
undescribed.

--
Ben Sizer
Don't miss IPython, too.

$ ipython
Python 2.4.1 (#2, Aug 25 2005, 18:20:57)
Type "copyright", "credits" or "license" for more information.

IPython 0.6.15 -- An enhanced Interactive Python.
? -Introduction to IPython's features.
%magic -Information about IPython's 'magic' % functions.
help -Python's own help system.
object? -Details about 'object'. ?object also works, ?? prints more.

In [1]: import email.FeedParser

In [2]: email.FeedParser.FeedParser?
Type: classobj
String Form: email.FeedParser.FeedParser
Namespace: Interactive
File: /usr/lib/python2.4/email/FeedParser.py
Docstring:
A feed-style parser of email.

Constructor information:
Definition: email.FeedParser.FeedParser(self, _factory=<class
email.Message.Message at 0xb77f5ddc>)
Docstring:
_factory is called with no arguments to create a new message obj
In [3]: help(email.FeedParser.FeedParser)
Help on class FeedParser in module email.FeedParser:

class FeedParser
| A feed-style parser of email.
|
| Methods defined here:
|
| __init__(self, _factory=<class email.Message.Message>)
| _factory is called with no arguments to create a new message
obj
|
| close(self)
| Parse all remaining data and return the root message object.
|
| feed(self, data)
| Push more data into the parser.
In [4]: email.FeedParser.FeedParser??
Type: classobj
String Form: email.FeedParser.FeedParser
Namespace: Interactive
File: /usr/lib/python2.4/email/FeedParser.py
Source:
class FeedParser:
"""A feed-style parser of email."""

def __init__(self, _factory=Message.Message):
"""_factory is called with no arguments to create a new message
obj"""
self._factory = _factory
self._input = BufferedSubFile()
self._msgstack = []
self._parse = self._parsegen().next
self._cur = None
...

Unfortunately, the nice colors of IPython are lost in the post :-(

Michele Simionato

Sep 8 '06 #7
Ben Sizer wrote:
xi*********@gmail.com wrote:
I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
I was going to recommend running something like epydoc [1] over the
standard library, but this has its pitfalls.
But in python, i find it kind of inconvient.

My advice is to get used to it... the Python docs are not arranged in
the hierarchical fashion because there isn't any real hierarchy to
speak of. Python does not rely heavily on inheritance like Java does.
Instead, it is used in just a few places, more like the C++ standard
library than the Java library.
Generating API documentation using epydoc really shows this aspect of
the Python standard library: a huge list of names (sched, sets,
sgmllib, shelve, shlex, shutil, site, stmpd, smtplib, sndheader,
socket, sre, ...) which have little inherent organisation on their own.
I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though. I
don't know if there's a solution to that anywhere.
Well, I used a very simple approach to get epydoc to format the
standard library documentation:

epydoc --parse-only --output=apidocs \
`find Lib -name test -prune -o -name "*.py" -print`

Better usage of the find command could be made, and the resulting
process occupied over 0.5GB before producing 581MB of API documents on
disk. The resulting output reveals some major differences between some
modules and in the quality of the documentation; for example, lots of
empty docstrings cannot always be explained away by the --parse-only
mode employed by epydoc in this case.

Certainly, those with ideas of reorganising the standard library ought
to consider the perspective of the questioner, along with the
possibilities for generating documentation using the various tools
available, in order to find inspiration in such matters.

Paul

[1] http://epydoc.sf.net/

Sep 8 '06 #8
xi*********@gmail.com writes:
Hi there,

I'm new to python and I'm from the java world.
Though I love to learn python, I'm not very comfortable with the python
documentation.
Because when i read jdk doc, i can see the class hierachy, class
member, class methods etc in html docs. It's very easy for me to
understand the Java language.
But in python, i find it kind of inconvient.
Are you talking about the Python standard library (the "stdlib"), or
the set of all Python modules in the world? The stdlib docs have a
pretty rigid format (though a few modules do vary -- and I don't in
principle begrudge authors some wiggle room, to allow them to say what
they want to say more clearly). It's just a different format to Java.
That's not *always* a capital offence ;-)

Outside any one project, in general, it has always seemed 10x more
important to me that the docs are set out in a way that suits that
project than it is to conform to some global standard. In fact, some
peoples' complacent assertions that Python docs are inferior for this
reason really winds me up ;-) Mind you, the last person who said that
to me was also Chinese, and I guess I can understand that, if Python
documentation were written in Chinese, the relative benefits of
flexibility and consistency in doc structure would be very different
for me!

In a few years it will be us English monoglots who will have to learn
Chinese to read *your* docs :-)

I have to say that, very recently, I've found making use of the
various API doc tools in Python of pretty painful, though -- but that
pain is precisely because of my decision to do exactly what's right
for my project, seeing little value -- other than implementation
convenience -- in following some global standard. If I just wanted
standard input and output formats, it is just as easy as in the Java
world -- for example, epydoc supports JavaDoc syntax (amongst other
formats), and PythonDoc follows JavaDoc's syntax fairly closely.

(Personally, I ended up using epydoc with my own patched HTML output
module, to get simpler and fewer pages out of it. PythonDoc is nice
for being far simpler, but I hate the XML-ish markup syntax.)

The Perl story used to be that the POD format was great because it
made people actually sit down and write docs. I can't say I've
noticed it stopping Python module authors writing docs, though:
docstrings and plain text or HTML work pretty well as a "never mind
the format, sit down and write the **** docs" format.

foolish-consistency-and-all-that-ly y'rs
John

Sep 8 '06 #9
"Paul Boddie" <pa**@boddie.org.ukwrites:
[...]
Better usage of the find command could be made, and the resulting
process occupied over 0.5GB before producing 581MB of API documents on
disk. The resulting output reveals some major differences between some
modules and in the quality of the documentation; for example, lots of
empty docstrings cannot always be explained away by the --parse-only
mode employed by epydoc in this case.
[...]

Why do you expect to get useful docs that way? The canonical Python
stdlib docs live in LaTeX files, not in the docstrings. You may find
some useful bits and pieces in the docstrings too, or you may not.
John
Sep 8 '06 #10
jj*@pobox.com (John J. Lee) writes:
Why do you expect to get useful docs that way? The canonical Python
stdlib docs live in LaTeX files, not in the docstrings. You may find
some useful bits and pieces in the docstrings too, or you may not.
Yucch. From

http://www.gnu.org/software/emacs/ma...-Criteria.html

"If the on-line documentation string of a function or variable
disagrees with the manual, one of them must be wrong; that is a bug."

I think that's preferable to Python's approach.
Sep 8 '06 #11
John J. Lee wrote:
>
[epydoc on the standard library]
Why do you expect to get useful docs that way? The canonical Python
stdlib docs live in LaTeX files, not in the docstrings. You may find
some useful bits and pieces in the docstrings too, or you may not.
But wasn't the questioner recommended to use pydoc, help and so on? As
far as I am aware, none of those things look in LaTeX files in order to
provide the documentation that they do dig up. It turns out that pydoc
(in graphical mode) manages to permit introspection of the known
modules on a system in a more presentable fashion than epydoc, although
epydoc is visually much more like javadoc. Still, both tools rely on
docstrings and might be adequate for packages outside the standard
library - it's just a shame that the standard library doesn't lend
itself as greatly to such inspection (with optimal results).

As far as the means of delivering the library documentation is
concerned, my understanding was that the LaTeX format approach wasn't
encouraging as many improvements to the library documentation as was
expected or desired. This is possibly not that surprising given the
docstring-oriented approach I imagine most developers take with their
own API documentation (in Python and through mostly equivalent
mechanisms in other languages).

Paul

Sep 8 '06 #12
Thanks for all replies regard with this question!
I think I will get used to python help system:)
Maybe I will look into epydoc, too...

-Xiong

Michele Simionato 写道:
Ben Sizer wrote:
Michele Simionato wrote:
Ben Sizer wrote:
I agree that the Python docs aren't quite as effective as reference
material due to the lack of simple function and method lists though.
>
http://docs.python.org/lib/modindex.html, pydoc and ipython are more
than enough for me.
modindex is comprehensive but too 'flat'. Sometimes you want to see all
of one object's methods and properties listed together.

I was unaware of pydoc until this thread; its existence seems to be
buried, somewhat. Looking at pydoc.org (assuming that is a good example
of it in use), it looks more like what the original poster and I might
want, but sadly it's still very inconsistent, with many things
undescribed.

--
Ben Sizer

Don't miss IPython, too.

$ ipython
Python 2.4.1 (#2, Aug 25 2005, 18:20:57)
Type "copyright", "credits" or "license" for more information.

IPython 0.6.15 -- An enhanced Interactive Python.
? -Introduction to IPython's features.
%magic -Information about IPython's 'magic' % functions.
help -Python's own help system.
object? -Details about 'object'. ?object also works, ?? prints more.

In [1]: import email.FeedParser

In [2]: email.FeedParser.FeedParser?
Type: classobj
String Form: email.FeedParser.FeedParser
Namespace: Interactive
File: /usr/lib/python2.4/email/FeedParser.py
Docstring:
A feed-style parser of email.

Constructor information:
Definition: email.FeedParser.FeedParser(self, _factory=<class
email.Message.Message at 0xb77f5ddc>)
Docstring:
_factory is called with no arguments to create a new message obj
In [3]: help(email.FeedParser.FeedParser)
Help on class FeedParser in module email.FeedParser:

class FeedParser
| A feed-style parser of email.
|
| Methods defined here:
|
| __init__(self, _factory=<class email.Message.Message>)
| _factory is called with no arguments to create a new message
obj
|
| close(self)
| Parse all remaining data and return the root message object.
|
| feed(self, data)
| Push more data into the parser.
In [4]: email.FeedParser.FeedParser??
Type: classobj
String Form: email.FeedParser.FeedParser
Namespace: Interactive
File: /usr/lib/python2.4/email/FeedParser.py
Source:
class FeedParser:
"""A feed-style parser of email."""

def __init__(self, _factory=Message.Message):
"""_factory is called with no arguments to create a new message
obj"""
self._factory = _factory
self._input = BufferedSubFile()
self._msgstack = []
self._parse = self._parsegen().next
self._cur = None
...

Unfortunately, the nice colors of IPython are lost in the post :-(

Michele Simionato
Sep 11 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dean A. Hoover | last post by:
I noticed in the sun sdk javadoc documentation for, say java.sql.PreparedStatement, that class names are not expanded. For example, the setString method takes a java.lang.String as one of its...
1
by: Krusty276 | last post by:
I'm getting this error when trying to compile javadoc in ant from my buildxml: Any ideas? C:\umg\java\web\dbtest\WEB-INF\src\build.xml:64: Javadoc failed: java.io.IOException: CreateProcess:...
1
by: Prakash | last post by:
Hi, I want to generate the JDK API using Javadoc. I have installed java 1.4.2 in WINDOWS. Since i don't have frequent access to the Net, i want to generate the Java API Help using javadoc.But I...
3
by: Olaf Meding | last post by:
I played a little with happydoc and pydoc and wonder which one I should use. Also, is there a better documentation general available (I am spoiled by javadoc). Lastly, I could not find good...
1
by: Alessandro Crugnola | last post by:
Hi all, i need to use a regular expression to match javadoc style comments in a file, something like /** * Constructs a new Call instance. * * @param object the object the Function shall be...
12
by: Vaibhav | last post by:
I recently heard about 'new-style classes'. I am very sorry if this sounds like a newbie question, but what are they? I checked the Python Manual but did not find anything conclusive. Could someone...
5
by: GoodMorningSky | last post by:
In java I can make documentation of all API I created. In C#, there is tags such as <summary> for documentation. However I don't know the tool like java tool. How to do so? Thank you.
12
by: Ilias Lazaridis | last post by:
Another topic has raised the need of a deeper teach-in. Where can I find _compact_ documentation about * Differece between New Style / Old Style Classes Are there any documents available...
2
by: rednarjess | last post by:
Hello every body; When I want to generate the Javadoc for my project, The result is fine at the bigining of the generating init: Generating Javadoc Javadoc execution Loading source file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.