Commit graph

4351 commits

Author SHA1 Message Date
Tim Peters
1fc240e851 Generalize dictionary() to accept a sequence of 2-sequences. At the
outer level, the iterator protocol is used for memory-efficiency (the
outer sequence may be very large if fully materialized); at the inner
level, PySequence_Fast() is used for time-efficiency (these should
always be sequences of length 2).

dictobject.c, new functions PyDict_{Merge,Update}FromSeq2.  These are
wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2-
sequences argument instead of a mapping object.  For now, I left these
functions file static, so no corresponding doc changes.  It's tempting
to change dict.update() to allow a sequence-of-2-seqs argument too.

Also changed the name of dictionary's keyword argument from "mapping"
to "x".  Got a better name?  "mapping_or_sequence_of_pairs" isn't
attractive, although more so than "mosop" <wink>.

abstract.h, abstract.tex:  Added new PySequence_Fast_GET_SIZE function,
much faster than going thru the all-purpose PySequence_Size.

libfuncs.tex:
- Document dictionary().
- Fiddle tuple() and list() to admit that their argument is optional.
- The long-winded repetitions of "a sequence, a container that supports
  iteration, or an iterator object" is getting to be a PITA.  Many
  months ago I suggested factoring this out into "iterable object",
  where the definition of that could include being explicit about
  generators too (as is, I'm not sure a reader outside of PythonLabs
  could guess that "an iterator object" includes a generator call).
- Please check my curly braces -- I'm going blind <0.9 wink>.

abstract.c, PySequence_Tuple():  When PyObject_GetIter() fails, leave
its error msg alone now (the msg it produces has improved since
PySequence_Tuple was generalized to accept iterable objects, and
PySequence_Tuple was also stomping on the msg in cases it shouldn't
have even before PyObject_GetIter grew a better msg).
2001-10-26 05:06:50 +00:00
Fred Drake
af07b2c34f Add yet more markup that let's a stylesheet pick out a small bit of the
presentation.  This is acceptable since it only occurs in the formatted
output and does not affect the document markup.
2001-10-26 03:09:27 +00:00
Fred Drake
7f10cce4c1 Enforce a bit of markup consistency.
When describing a Boolean return value, use "true" and "false" instead of
"1" and "0".
Style-guide conformance:  no "iff" -- to obscure for many readers.  ;-(
2001-10-26 03:04:23 +00:00
Fred Drake
3a2c462436 Minor textual adjustment, and style-guide conformance (no use of "iff"). 2001-10-26 03:00:39 +00:00
Barry Warsaw
107771a228 Applying proposed patch for bug #474583, optional support for
non-standard but common types.  Including Martin's suggestion to add
rejected non-standard types from patch #438790.  Specifically,

guess_type(), guess_extension(): Both the functions and the methods
grow an optional "strict" flag, defaulting to true, which determines
whether to recognize non-standard, but commonly found types or not.

Also, I sorted, reformatted, and culled duplicates from the big
types_map dictionary.  Note that there are a few non-equivalent
duplicates (e.g. .cdf and .xls) for which the first will just get
thrown away.  I didn't remove those though.

Finally, use of the module as a script as grown the -l and -e options
to toggle strictness and to do guess_extension(), respectively.

Doc and unittest updates too.
2001-10-25 21:49:18 +00:00
Fred Drake
61f794918f Typo: NamedNodeList --> NamedNodeMap 2001-10-25 20:42:57 +00:00
Fred Drake
847c51a181 Slightly better conformance to the Python C style guide. 2001-10-25 15:53:44 +00:00
Fred Drake
af876d77e0 One more LaTeX-ism that we'd rather ignore. 2001-10-25 15:14:57 +00:00
Fred Drake
a281665972 No need to run make twice here. 2001-10-25 15:13:30 +00:00
Fred Drake
0099d8f8fb Update the rules so that changes to the HTML stylesheet cause appropriate
work to be done, but do not require the HTML to be re-built.
2001-10-25 15:12:31 +00:00
Fred Drake
bc006af3d0 Make the deprecation notice use the same form as other such notices.
This has sat around in a deprecated state for a *long* time!
2001-10-24 21:56:59 +00:00
Fred Drake
0559d95fd6 Minor revision of the text. 2001-10-24 21:10:52 +00:00
Fred Drake
08fd51509c When describing "import *", add a level of indirection between "*" and the
set of names imported (the "public names"), adding a definition of "public
names" that describes the use of __all__.
This closes SF bug #473986.

Flesh out the vague reference to __import__().
2001-10-24 19:50:31 +00:00
Fred Drake
c84f2c5068 Documentation for the new PyArg_UnpackTuple() function. 2001-10-23 21:10:18 +00:00
Andrew M. Kuchling
4855b02554 Fill out section on how to write a new-style class 2001-10-23 20:26:16 +00:00
Tim Peters
98791affc8 Doc and NEWS changes due to Jeremy adding traceback objects to gc. 2001-10-23 01:59:54 +00:00
Barry Warsaw
d05e051aa7 Fixed an example in the use of email.Utils.getaddresses(). The
failobj has to be a list or the `+' can fail.
2001-10-22 20:53:45 +00:00
Fred Drake
a219b411af Add better support for Mozilla's use of <link> elements. 2001-10-22 16:57:49 +00:00
Andrew M. Kuchling
32e3232a55 Update bug/patch counts 2001-10-22 15:32:05 +00:00
Fred Drake
f10584cb11 Do a little bit more to try and add <link> elements to the header, not that
Mozilla 0.9.5 can make intelligent use of them.  Specifically, this causes
the "Acknowledgements" and "Global Module Index" pages to acquire "up"
links in the Mozilla "Site Navigation Bar".
This partially responds to SF bug #469772.
2001-10-22 15:07:16 +00:00
Fred Drake
5d9a6b575c Clarify that the resource module does not attempt to mask platform
differences by defining symbols not defined on particular platforms.
This closes SF bug #473433.
2001-10-22 14:18:23 +00:00
Andrew M. Kuchling
beb385568c Add correction from /F about SRE
\filename{} should be \file{}
2001-10-22 14:11:06 +00:00
Andrew M. Kuchling
279e744573 Partly fill out the PEP 252 section 2001-10-22 02:03:40 +00:00
Andrew M. Kuchling
8b42f01667 A bunch of minor rewordings 2001-10-22 02:00:11 +00:00
Andrew M. Kuchling
9dbc0bcf9d Update description of border() 2001-10-20 16:07:41 +00:00
Fred Drake
0aa811c527 Use the \note and \warning macros where appropriate. 2001-10-20 04:24:09 +00:00
Fred Drake
64a5aaf05c Describe the content given as the parameter to the \note and \warning macros
in more detail, and use them where appropriate.
2001-10-20 04:18:14 +00:00
Fred Drake
0c77cf15c0 Additional rules to support the iSilo conversion. 2001-10-19 21:12:57 +00:00
Fred Drake
5a4bdb7be8 Hush up CVS. 2001-10-19 21:09:19 +00:00
Fred Drake
cc2e306592 Support for the iSilo conversion. 2001-10-19 21:08:36 +00:00
Fred Drake
aad8bb5d7a When stating that some parameters to makefile() are similar to the open()
parameters, given a hyperlink to the right part of the documentation to
make it easier to look those up.  Also, refer to the file() function/
constructor instead of open() now that that is where the actual docs for
those parameters live.
This closes SF bug #472004.
2001-10-19 17:22:29 +00:00
Marc-André Lemburg
b5507ecd3c Additional test and documentation for the unicode() changes.
This patch should also be applied to the 2.2b1 trunk.
2001-10-19 12:02:29 +00:00
Barry Warsaw
e736d93eab Added a note about the somewhat kludgey behavior of the message
epilogue, based on the discussion in this SF bug report:

https://sourceforge.net/tracker/index.php?func=detail&aid=472481&group_id=25568&atid=384678
2001-10-19 04:34:42 +00:00
Guido van Rossum
b6c1d5239c SF patch #443759: Add Interface to readline's add_history
This was submitted by Moshe, but apparently he's too busy to check it
in himself.  He wrote:

    Here is a function in GNU readline called add_history,
    which is used to manage the history list. Though Python
    uses this function internally, it does not expose it to
    the Python programmer. This patch adds direct interface
    to this function with documentation.

    This could be used by friendly modules to "seed" the
    history with commands.
2001-10-19 01:18:43 +00:00
Fredrik Lundh
a5e616510e changed misleading argument name 2001-10-18 20:58:25 +00:00
Barry Warsaw
91b81c4802 Some minor clarifications for find()'s arguments based on SF bug
#463572.  Closing.
2001-10-18 19:41:48 +00:00
Fred Drake
db7287c0f5 Straighten out the exec*() function descriptions a bit, and clarify a few
points in the spawn*() description.
2001-10-18 18:58:30 +00:00
Fred Drake
9ae09947f4 Bump version number.
Remove inconsistent use of HTMLDIR.
2001-10-18 18:46:22 +00:00
Fred Drake
77165d039f Bump release information. 2001-10-18 18:41:12 +00:00
Fred Drake
316141b333 Fix typo reported by Michael Soulier. 2001-10-18 15:22:23 +00:00
Fred Drake
ca836f7e65 Function descriptions must end as well as start! 2001-10-18 14:26:08 +00:00
Martin v. Löwis
c405133fce Elaborate on types and meaning of the setgroups arguments. 2001-10-18 14:07:12 +00:00
Martin v. Löwis
61c5edf6fc Expose setgroups. Fixes feature request #468116. 2001-10-18 04:06:00 +00:00
Tim Peters
61acf067ac SF bug [#471111] inspect.getframeinfo() needs docs.
TeX-ified its docstring.
2001-10-16 23:01:06 +00:00
Guido van Rossum
3c28863e08 Partial patch from SF #452266, by Jason Petrone.
This changes Pythread_start_thread() to return the thread ID, or -1
for an error.  (It's technically an incompatible API change, but I
doubt anyone calls it.)
2001-10-16 21:13:49 +00:00
Jeremy Hylton
511e2cacc4 [ #403753 ] zlib decompress; uncontrollable memory usage
Mostly by Toby Dickenson and Titus Brown.

Add an optional argument to a decompression object's decompress()
method.  The argument specifies the maximum length of the return
value.  If the uncompressed data exceeds this length, the excess data
is stored as the unconsumed_tail attribute.  (Not to be confused with
unused_data, which is a separate issue.)

Difference from SF patch: Default value for unconsumed_tail is ""
rather than None.  It's simpler if the attribute is always a string.
2001-10-16 20:39:49 +00:00
Guido van Rossum
7a59445e37 Document required return values -1, 0, 1 for tp_compare handler, as
suggested in SF patch #424475.  Also document exception return.
2001-10-16 20:32:05 +00:00
Fred Drake
5bf1ecd503 Update the description of PyTrace_EXCEPT. 2001-10-16 19:23:55 +00:00
Fred Drake
ab9b238ced Fix a few usage and style-guide conformance issues. 2001-10-16 19:22:51 +00:00
Fred Drake
64d7863797 Added information about setprofile() and settrace() hooks being thread-
specific, and updated some of the comments about the profile hook.
This closes SF bug #471725.
2001-10-16 14:54:22 +00:00