tutor(function|module)
Hi all- I'm new to the mailing list so I'd like to introduce myself. My name is Christopher Blunck and I'm fairly new to the Python language. I am a Java developer (please do not mock me) professionally, but use Python in all of my home projects and the open source projects I contribute to. Now on to my question. Not sure if this is the proper forum to ask this, or if it has even been discussed before, so apologies in advance if this is inappropriate. Question #1: How can I contribute to the documentation effort? As a new python developer, I use "help(function)" frequently. In a lot of cases, I learn exactly what I need from help(function). Other times, I don't. In those cases I hit google, or my "Python Cookbook", or give a holler to friends through instant messaging and the answer usually comes. When I do figure out something (either by myself or with the help of one of the resources above), I'd like to contribute that knowledge *back* to the project by improving what is displayed by help(function). How can I do so? Question #2: How about examples(function) that displays multiple examples of how to use the function provided? Similar to above, there are times when I look at the API and even if the parameters to the function are fully explained, it would help to have an example (case in point is os.path.walk - docs are great, but an example of how to make use of the third parameter (the arg you pass) would really clarify why 'the powers that be' chose to implement this capability. -c -- 12:35pm up 75 days, 3:51, 2 users, load average: 5.37, 5.14, 5.08
[Christopher Blunck]
I'm new to the mailing list so I'd like to introduce myself. My name is Christopher Blunck and I'm fairly new to the Python language.
Welcome!
I am a Java developer (please do not mock me) professionally, but use Python in all of my home projects and the open source projects I contribute to.
The latter half of that sentences will stem the mocking. =)
Not sure if this is the proper forum to ask this, or if it has even been discussed before, so apologies in advance if this is inappropriate.
It's OK. Question #1 kind of isn't since it is documented on how to go about this, but Question #2 is okay to ask here.
Question #1: How can I contribute to the documentation effort?
Look around at http://www.python.org/dev/ . There is info there about how to help with the documentation effort and how to do patches to SourceForge.
Question #2: How about examples(function) that displays multiple examples of how to use the function provided? Similar to above, there are times when I look at the API and even if the parameters to the function are fully explained, it would help to have an example (case in point is os.path.walk - docs are great, but an example of how to make use of the third parameter (the arg you pass) would really clarify why 'the powers that be' chose to implement this capability.
-1 If you look in the source distribution for Python there is a directory called Demos/ that has just examples of how to use things. Stuff like what you are suggesting can go there. You can also write an examples page for the documentation. But I don't think it belongs in the language itself. If we started doing that we would take on the role of Python Cookbook and c.l.py and that is more work than we need. =) -Brett
On Saturday 04 January 2003 13:05, Brett Cannon wrote:
[Christopher Blunck]
Question #2: How about examples(function) that displays multiple examples of how to use the function provided? Similar to above, there are times when I look at the API and even if the parameters to the function are fully explained, it would help to have an example (case in point is os.path.walk - docs are great, but an example of how to make use of the third parameter (the arg you pass) would really clarify why 'the powers that be' chose to implement this capability.
If you look in the source distribution for Python there is a directory called Demos/ that has just examples of how to use things. Stuff like what you are suggesting can go there.
Perhaps an importable "examples" module, which could have, well, examples of things. It could and would be a separately maintained module, but would probably be useful to me and others it it just had examples of all the standard library functions (contributed to on a volunteer basis). hmmmmm... Best to move to python-list for followups... -- Bay Area Python Interest Group - http://www.baypiggies.net/ Chad Netzer cnetzer@mail.arc.nasa.gov
[Christopher Blunck]
Question #2: How about examples(function) that displays multiple examples of how to use the function provided? Similar to above, there are times when I look at the API and even if the parameters to the function are fully explained, it would help to have an example (case in point is os.path.walk - docs are great, but an example of how to make use of the third parameter (the arg you pass) would really clarify why 'the powers that be' chose to implement this capability.
If you look in the source distribution for Python there is a directory called Demos/ that has just examples of how to use things. Stuff like what you are suggesting can go there.
[Chad Netzer]
Perhaps an importable "examples" module, which could have, well, examples of things. It could and would be a separately maintained module, but would probably be useful to me and others it it just had examples of all the standard library functions (contributed to on a volunteer basis). hmmmmm...
I'm not sure what you would want to do after importing the examples module; it's not easy to look at the source of an imported module, and that's (presumably) what you want to do with an examples module. IMO examples belong in the documentation. The problem with the Demo directory is that few people have bothered to contribute or even weed out obsolete code, and so the collection there is quite stale. I would welcome contributions of any kind, but especially useful would be a somewhat separate project with the explicit goal of providing working examples of all the important parts of Python. Watch out for focusing too much on all the standard library functions; much of Python's power is in things that aren't functions (e.g. syntactic constructs, or methods, or classes, or modules). --Guido van Rossum (home page: http://www.python.org/~guido/)
On zaterdag, jan 4, 2003, at 22:05 Europe/Amsterdam, Brett Cannon wrote:
Question #2: How about examples(function) that displays multiple examples of how to use the function provided? Similar to above, there are times when I look at the API and even if the parameters to the function are fully explained, it would help to have an example (case in point is os.path.walk - docs are great, but an example of how to make use of the third parameter (the arg you pass) would really clarify why 'the powers that be' chose to implement this capability.
-1
If you look in the source distribution for Python there is a directory called Demos/ that has just examples of how to use things. Stuff like what you are suggesting can go there.
You can also write an examples page for the documentation.
But I don't think it belongs in the language itself.
I agree that it doesn't belong in the language itself, but what would be nice is if the help module could point you to examples. A first stab at this could be to use a well-defined naming scheme for the examples (so that examples for the "os" module would be in "Demos/os", and examples of os.walk() would be in, say, Demos/os/walk.py or walk_1.py and walk_2.py). And this could be extended with having index files in the Demos tree which would map Python names to example files. For example, if there was a demo Demos/os/renamefilesintreetouppercase.py then and index file in Demos/os could tell the help module that this is a useful file to examine if you're interested in os.walk or os.path. -- - Jack Jansen <Jack.Jansen@oratrix.com> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -
[Jack Jansen]
I agree that it doesn't belong in the language itself, but what would be nice is if the help module could point you to examples. A first stab at this could be to use a well-defined naming scheme for the examples (so that examples for the "os" module would be in "Demos/os", and examples of os.walk() would be in, say, Demos/os/walk.py or walk_1.py and walk_2.py). And this could be extended with having index files in the Demos tree which would map Python names to example files. For example, if there was a demo Demos/os/renamefilesintreetouppercase.py then and index file in Demos/os could tell the help module that this is a useful file to examine if you're interested in os.walk or os.path.
This is more reasonable, but I still have reservations over having this kind of thing in the core. It isn't over whether it is useful or not, but whether people who do the bulk of CVS checkins want to be bothered with reading a possible deluge of example Python code on top of their usual Python work. Isn't the Cookbook supposed to cover stuff like this? And it was suggested to have a separate ``examples`` package, but that might be a barrier of entry for newbies (albeit a low barrier). -Brett
On Sat, Jan 04, 2003 at 02:44:19PM -0800, Brett Cannon wrote:
And it was suggested to have a separate ``examples`` package, but that might be a barrier of entry for newbies (albeit a low barrier).
There seems to be diverging opinions in this thread, which I think is good. While I recognize (I have also personally used them) the existence of the "Demos" section in CVS, chances are strong that newbies do not. If somebody is bright enough to pull the python cvs module, build it, and use it then they probably are bright enough to discover the Demos. But the bright ones are not the folks I'm thinking about right now - I'm thinking of the common case user who gets a Linux distro with python installed out-of-the-box. They may be totally new to programming and have never even heard of CVS before (and thus wouldn't have the Demos available to them). Maybe I'm not familiar with very many py installations for platforms other than my own, so feel free to correct me if the Demos *do* come pre-installed on many different environments. :) I also recognize that this is ?feature? is not a core language functionality. But due to its special nature (I put this into the same area as help) I think that it does warrant thought about if it deserves to be included as a core feature *simply because* it might really help newbies out. A web page full of examples would be great, but again - would Joe New User know about the web page if they didn't even know about the lang (because it came pre-installed)? I don't know... It is encouraging to read peoples comments on this. It appears as tho there may be a desire for this feature. -c -- 8:20pm up 75 days, 11:36, 3 users, load average: 4.54, 4.82, 4.89
[Christopher Blunck]
On Sat, Jan 04, 2003 at 02:44:19PM -0800, Brett Cannon wrote:
And it was suggested to have a separate ``examples`` package, but that might be a barrier of entry for newbies (albeit a low barrier).
There seems to be diverging opinions in this thread, which I think is good.
Stick around; divergence happens all the time here at python-dev. =)
While I recognize (I have also personally used them) the existence of the "Demos" section in CVS, chances are strong that newbies do not.
Especially since it is not included in the Windows distro.
If somebody is bright enough to pull the python cvs module, build it, and use it then they probably are bright enough to discover the Demos. But the bright ones are not the folks I'm thinking about right now - I'm thinking of the common case user who gets a Linux distro with python installed out-of-the-box.
I wouldn't worry about people like that either. I think the question here is how do most people learn about Python. For instance, how do people even learn about the ``help()`` function? If they get it from the docs, we can point them to whatever to learn about examples. If they learn from a friend, then they probably would (and should) tell them where to get examples. And if they learn about it from launching the interpreter and typing ``help``, well that can have an added line mentioning where to go to get examples.
They may be totally new to programming and have never even heard of CVS before (and thus wouldn't have the Demos available to them). Maybe I'm not familiar with very many py installations for platforms other than my own, so feel free to correct me if the Demos *do* come pre-installed on many different environments. :)
It is not installed. You get it only with the source code.
I also recognize that this is ?feature? is not a core language functionality. But due to its special nature (I put this into the same area as help) I think that it does warrant thought about if it deserves to be included as a core feature *simply because* it might really help newbies out.
I still think putting it in the documentation is the better solution. ``help()`` should really be used as a quick reference. If that quick reference is not enough you should read the documentation which can have examples to help clarify usage.
A web page full of examples would be great, but again - would Joe New User know about the web page if they didn't even know about the lang (because it came pre-installed)? I don't know...
See above. -Brett
"CB" == Christopher Blunck <blunck@gst.com> writes:
CB> I also recognize that this is ?feature? is not a core language CB> functionality. But due to its special nature (I put this into CB> the same area as help) I think that it does warrant thought CB> about if it deserves to be included as a core feature *simply CB> because* it might really help newbies out. CB> A web page full of examples would be great, but again - would CB> Joe New User know about the web page if they didn't even know CB> about the lang (because it came pre-installed)? I don't know... I expect that a newbie is better able to use Google then he or she is able to poke around a Python installation. Creating a web page is a good way to serve them. An added benefit is that people can vote with their clicks. If you write a great tutorial, people will find it via a search engine. If someone writes a greater tutorial, people can use it instead. Jeremy
participants (6)
-
Brett Cannon
-
Chad Netzer
-
Christopher Blunck
-
Guido van Rossum
-
Jack Jansen
-
Jeremy Hylton