[Tutor] Python Docs (Was: Reformatting phone number)

Dotan Cohen dotancohen at gmail.com
Thu Aug 21 18:01:46 CEST 2008

2008/8/21 Kent Johnson <kent37 at tds.net>:
> Chapters 2 and 3 of the library reference are highly recommended.
> http://docs.python.org/lib/lib.html

Let's start from there. I need the startswith() function, but I do not
know it's name. I search for "strings" and find this:
4. String Services
    * 4.1 string -- Common string operations
          o 4.1.3 String functions

But on that page, this is all there is:
The following functions are available to operate on string and Unicode
objects. They are not available as string methods.

capwords( 	s)
[snip description]
maketrans( 	from, to)
[snip description]
Warning: Don't use strings derived from lowercase  and uppercase as
arguments; in some locales, these don't have the same length. For case
conversions, always use lower() and upper().

So Python has only two string functions? That's what it looks like.

> In particular:
> 2.1 Built-in Functions lists all globally available functions
> (functions that are not part of a class)
> 3.6 Sequence Types gives operations on strings, lists and tuples
> (which are all sequences)
> 3.6.1 String Methods includes endswith()
> 3.8 Mapping Types -- dict
> etc.

I will start with those, thanks.

> Many Python functions are grouped into library modules.  You could
> consider this to be the grouping by category that you want. The rest
> of the library reference (after chapter 3) documents the modules.
> Browse the table of contents to see what is available.
> And you are welcome to ask this group if you can't find what you are
> looking for.

Thanks, Kent. I will be a nuisance! Is there any place to suggest
improvements to the docs? I see on the python.org site it is suggested
to email website bugs to the site admin. Does that go for the docs? I
am not the one to improve them at this time, as I am unfamiliar with
the language, but I could report usability issues such as that
mentioned here.

Dotan Cohen



More information about the Tutor mailing list