Commit Graph

8415 Commits

Author SHA1 Message Date
Guido van Rossum 832f6d2890 Add an alias (and preferred name) "contains" for "sequenceIncludes".
Rationalized the doc strings.

Also simplify the module initialization -- we don't need a __version__
which is set to "$Rev" :-) and we don't need a fatal error when the
initialization fails.
1998-05-22 18:12:59 +00:00
Guido van Rossum e9387ea773 introduce a new platform-specific variable: os.linesep is the
platform's line separator.  \n on Unix, \r\n on DOS, OS/2 and Windows,
\r on Macs.
1998-05-22 15:26:04 +00:00
Guido van Rossum fa0b6ab01a Address some gcc -Wall warnings (e.g. include <ctype.h>).
Make sure that no tp_as_numbers->nb_<whatever> function is called
without checking for a NULL pointer.  Marc-Andre Lemburg will love it!
(Except that he's just rewritten all this code for a different
approach to coercions ;-( )
1998-05-22 15:23:36 +00:00
Guido van Rossum 26fd98201f Change the last 4-space indent into a 1-tab indent. 1998-05-22 15:05:36 +00:00
Guido van Rossum 7ef2a1de9b Shouldn't use newdir.dir(), which no longer exists! 1998-05-22 14:11:57 +00:00
Guido van Rossum b88679b2a4 I think there was a tiny bug in new_function() -- the 'defaults'
argument was initialized to Py_None, but later checked for NULL.
Consistently use Py_None.
1998-05-22 00:57:31 +00:00
Guido van Rossum c8498dc604 Add PyErr_PrintEx and PySequence_Contains. 1998-05-22 00:56:20 +00:00
Guido van Rossum 0dabacee16 Make function objects somewhat mutable -- the members func_code,
func_defaults and func_doc (alias __doc__) may be assigned to.  For
the first two, there's a type restriction to code object and tuple,
respectively.
1998-05-22 00:55:34 +00:00
Guido van Rossum b1ed9c5295 PySequence_In() -> PySequence_Contains(). 1998-05-22 00:54:16 +00:00
Guido van Rossum 7df115de65 Make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.
1998-05-22 00:53:47 +00:00
Guido van Rossum 1c4f458099 In PyObject_IsTrue(), don't call function pointers that are NULL
(nb_nonzero, mp_length, sq_length).
1998-05-22 00:53:24 +00:00
Guido van Rossum 7e33c6e896 Moved cmp_member() to abstract.c, as PySequence_Contains() [with
swapped arguments].

Also make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.
1998-05-22 00:52:29 +00:00
Guido van Rossum 09df08a105 A bunch of functions are now properly implemented in abstract.c, and
the code here becomes much simpler.  In particular: abs(), divmod(),
pow(), int(), long(), float(), len(), tuple(), list().

Also make sure that no use of a function pointer gotten from a
tp_as_sequence or tp_as_mapping structure is made without checking it
for NULL first.

A few other cosmetic things, such as properly reindenting slice().
1998-05-22 00:51:39 +00:00
Guido van Rossum 44e4d5a6fd Renamed PySequence_In() to PySequence_Contains(). 1998-05-22 00:47:25 +00:00
Guido van Rossum cea1c8ca22 Completely reformatted, standardizing indentation as well as
programming style.

Recoded many routines to incorporate better error checking, and/or
better versions of the same function found elsewhere
(e.g. bltinmodule.c or ceval.c).  In particular,
Py_Number_{Int,Long,Float}() now convert from strings, just like the
built-in functions int(), long() and float().

Sequences and mappings are now safe to have NULL function pointers
anywhere in their tp_as_sequence or tp_as_mapping fields.  (A few
places in other files need to be checked in too.)

Renamed PySequence_In() to PySequence_Contains().
1998-05-22 00:47:05 +00:00
Fred Drake c9132066e7 knownfiles: Add the default installation dirs for Apache
versions <= 1.2, >= 1.3.
1998-05-21 13:15:45 +00:00
Guido van Rossum adf0e437cb Trivial little change: when setting a member to an object, hold the
old value in a temporary and XDECREF it only after then new value has
been set.  This prevents the (unlikely) case where the destructor of
the member uses the containing object -- it would find it in an
undefined state.
1998-05-20 22:25:32 +00:00
Fred Drake 885215c3da Added support for AMK's {definitions} environment; thanks for the reminder! 1998-05-20 21:32:09 +00:00
Fred Drake 3bf7865a20 Added {definitions} environment, which has \term to define indivual terms.
Similar to {description}.
1998-05-20 17:42:17 +00:00
Guido van Rossum 6c3a2cbc52 whrandom -> random 1998-05-20 17:13:01 +00:00
Guido van Rossum b26a1b4e2b Use random instead of whrandom. 1998-05-20 17:05:52 +00:00
Guido van Rossum 33d7f1a76c Add Interfaces to replace remaining needs for importing whrandom.
# XXX TO DO: make the distribution functions below into methods.
1998-05-20 16:28:24 +00:00
Guido van Rossum 750c8cee7e Add LDLAST to the list of variables processed by the sed script. 1998-05-20 15:53:22 +00:00
Guido van Rossum a88c5f30c7 Correct bug doc string (discovered by Berthold Hoellmann):
get_line_buffer() does not take an optional argument.
1998-05-20 15:50:56 +00:00
Guido van Rossum 0bd5433cf8 Get rid of nearly all clals to self._do -- turns out self.tk.call can
be used just as well, so this saves one Python call in many cases!
1998-05-19 21:18:13 +00:00
Guido van Rossum 29892d848c Use whrandom instead of rand.
Run 500 steps instead of forever.
1998-05-19 21:16:10 +00:00
Guido van Rossum 15527e98cd Protection agains non-existing subdirectories for clean and clobber
targets.  On some platforms this would cause an infinite Make
recursion.  Also remove "Doc" from the SUBDIRSTOO variable, since it
no longer exists in the standard distribution.
1998-05-19 21:15:03 +00:00
Guido van Rossum 110f3652d6 Additions for Mark Hammond's Win32 specific hacks. 1998-05-19 20:18:37 +00:00
Fred Drake e194beb829 Don't use a separate node for footnotes; see if people scream. ;-) 1998-05-19 19:38:49 +00:00
Fred Drake e87ab1fbf2 Fix definition of release_version (global). 1998-05-19 19:37:55 +00:00
Fred Drake 7c68ab2f2b Added entry for mimetypes. 1998-05-19 19:13:01 +00:00
Fred Drake 806a1bf34f webcheck target in this Makefile wasn't used. 1998-05-19 18:04:44 +00:00
Fred Drake 79c0f0efc4 Fix the webcheck target so it checks the right files.... 1998-05-19 18:04:13 +00:00
Barry Warsaw 3bfed5b6b1 (py-ask-about-save): New variable used in
py-execute-import-or-reload.  Same semantics as
compilation-ask-about-save.
1998-05-19 16:25:04 +00:00
Barry Warsaw 1d0364b2dc (py-execute-string): Bind to C-c C-s, and put on menu 1998-05-19 16:15:26 +00:00
Barry Warsaw 751f4931d8 (py-stringlit-re): Another ME patch to recognize SQTQs and DQTQs
(single and double quoted triple quoted strings :-) with embedded
single like-quotes.  Also recognizes raw prefix.
1998-05-19 16:06:21 +00:00
Barry Warsaw 820273d6d1 More ME patches:
(py-execute-import-or-reload): Cool new command that imports or
reloads the current file as a module, so as not to clutter the global
namespace.  Bound to C-c C-m.

(py-execute-def-or-class): New command that sends the current def or
class to the interpreter.  Bound to C-M-x.

(py-execute-string): New command that sends arbitrary string to the
interpreter.  Not bound by default.

(py-describe-mode): Doco updates.
1998-05-19 15:54:45 +00:00
Barry Warsaw ab0e86cbcc (beginning-of-python-def-or-class): Renamed to
py-beginning-of-def-or-class, and defaliased for backwards
compatibility.  ME patch to add optional second argument, count.

(end-of-python-def-or-class): Renamed to py-end-of-def-or-class, and
defaliased for backwards compatibility.  ME patch to add optional
second argument, count.
1998-05-19 15:31:46 +00:00
Fred Drake 4941341858 guess_extension(): Revise documentation string to be more clear. If not
inited, call init().
1998-05-19 15:15:59 +00:00
Guido van Rossum 5f4fb913a2 Test that "import sys.imp" fails as it should. 1998-05-19 15:09:42 +00:00
Guido van Rossum 9c0afe5dc7 Fix a curious bug: statements like "import sys.time" would succeed,
because the path through the code would notice that sys.__path__ did
not exist and it would fall back to the default path (builtins +
sys.path) instead of failing).  No longer.
1998-05-19 15:09:05 +00:00
Fred Drake edde150127 Add mimetypes documentation to library reference dependencies. 1998-05-19 15:04:21 +00:00
Fred Drake b818b46b38 Add section documenting mimetypes module. 1998-05-19 15:03:45 +00:00
Barry Warsaw ebc7b7ac45 More ME patches:
(py-shell): Recognize the Python debugger prompt

(py-jump-to-exception): Force into python-mode any buffer that gets
jumped to on exception.  Cope with py-exception-buffer possibly a
cons.
1998-05-19 15:01:06 +00:00
Barry Warsaw 145ab1ce9d #Documentation and comment typos patch given by Michael Ernst. More
#of his patches to follow.
1998-05-19 14:49:49 +00:00
Guido van Rossum e35c60156b Add a feature to support specifying an additional search directory for
packages.  (Mark Hammond)

Folded some long lines.
1998-05-18 20:25:54 +00:00
Guido van Rossum ce5988b3d9 Remove Emacs cruft. 1998-05-18 20:22:31 +00:00
Guido van Rossum f1b5a0e3aa Add a feature to support specifying an additional search directory for
packages.  (Mark Hammond)

Remove Emacs cruft.
1998-05-18 20:21:56 +00:00
Fred Drake 5109ffd607 guess_extension(): New function. Performs a reverse mapping from MIME type
to filename extension.
1998-05-18 16:27:20 +00:00
Guido van Rossum 67133e25a2 Neatify the _timezones table and remove a misleading comment about
inaccuracies in mktime_tz().
1998-05-18 16:09:10 +00:00