Guido van Rossum [Mon, 29 Jun 1998 20:32:57 +0000 (20:32 +0000)]
For completeness, add a dummy load_package() method to RHooks. It
should never be called, so this isn't really needed, but this
signifies that rexec now supports packages -- because ihooks does.
Guido van Rossum [Mon, 29 Jun 1998 20:29:08 +0000 (20:29 +0000)]
Added findall() to RegexObject -- return a list of all matches in a
string. Added groupdict() to MatchObject -- return the named groups
as a dict. Added default argument to groups() to specify what to
return for unmatching groups; groupdict() also has this.
Guido van Rossum [Sat, 27 Jun 1998 21:53:17 +0000 (21:53 +0000)]
Windows-specific hack to make sure that when LoadLibrary() is called,
the filename contains at least a rudimentary pathname.
(The bad part is that we need to call getcwd() because only a prefix
of ".\\" is not enough -- we prefix the drive letter.)
Guido van Rossum [Sat, 27 Jun 1998 18:25:44 +0000 (18:25 +0000)]
Document optional kwargs argument to start_new_thread(). Also
document new LockType and reverse the preference for exit()
vs. exit_thread() -- exit() is now preferred and exit_thread() is
obsolete.
Jack Jansen [Fri, 26 Jun 1998 14:56:00 +0000 (14:56 +0000)]
Mac version of freeze. Uses standard freeze modules where it can,
augmenting them here and there. For now, it works more-or-less similar
to unix/windows freeze, generating a config.c file, but storing
modules in PYC resources. A template project is also copied.
The hooks are in place to freeze by merging shared libraries so you
can freeze without a C compiler/linker, but this does not work yet.
Guido van Rossum [Tue, 23 Jun 1998 19:31:19 +0000 (19:31 +0000)]
Subsume the interact() function in a class. This should make it
possible to use this in PythonWin, and to replace Fredrik Lundh's
PythonInterpreter class. Fredrik is credited with the class' API.
Guido van Rossum [Mon, 22 Jun 1998 14:07:36 +0000 (14:07 +0000)]
Revert the change of revision 1.30. While it's in general a laudable
goal to use isinstance(x, y) instead of comparing type(x) to y, it
doesn't make sense to change this in the example code for the type()
builtin...
Guido van Rossum [Mon, 22 Jun 1998 03:54:15 +0000 (03:54 +0000)]
Fix the tests for various anomalies in the string-to-numbers
conversions. Formerly, for example, int('-') would return 0 instead
of raising ValueError, and int(' 0') would raise ValueError
(complaining about a null byte!) instead of 0...
Guido van Rossum [Fri, 19 Jun 1998 04:35:45 +0000 (04:35 +0000)]
Turns out that 'winfo id' returns the id as a hex string, with 0x prefix.
The int() function (aliased to getint()) doesn't handle that, so we must
use self.tk.getint() again...
Guido van Rossum [Fri, 19 Jun 1998 04:28:10 +0000 (04:28 +0000)]
There was an error check in a loop in PythonCmd which called
PythonCmd_Error() but failed to return. The error wasn't very likely
(only when we run out of memory) but since the check is there we might
as well return the error. (I think that Barry introduced this buglet
when he added error checks everywhere.)
Guido van Rossum [Wed, 17 Jun 1998 22:37:26 +0000 (22:37 +0000)]
Documented that by default the output goes to stderr, and that a file
keyword argument can be used to direct it somewhere else. Also
documented all the other functions in this module, and even added a
little example.
# Haven't tested the latex for correctness -- all latex installations
# appear broken.
Guido van Rossum [Wed, 17 Jun 1998 18:34:40 +0000 (18:34 +0000)]
In class _Subfile, make sure read(n) can't read beyond EOF. Also
allow negative numbers to specify read until EOF (like for a regular
file's read() method).
Guido van Rossum [Wed, 17 Jun 1998 15:16:40 +0000 (15:16 +0000)]
Change the description of input() -- it is exactly equivalent to
eval(raw_input(s)). The statement about breaking a long expression
over multiple lines is no longer true.
Guido van Rossum [Wed, 17 Jun 1998 14:15:44 +0000 (14:15 +0000)]
Minor cleanup by Tim after my changes:
+ Took the "list" argument out of the other functions that no longer need
it. This speeds things up a little more.
+ Small comment changes in accord with that.
+ Exploited the now-safe ability to cache values in the partitioning loop.
Makes no timing difference on my flavor of Pentium, but this machine ran out
of registers 12 iterations ago. It should yield a small speedup on a RISC
machine, and not hurt in any case.
Guido van Rossum [Tue, 16 Jun 1998 15:18:28 +0000 (15:18 +0000)]
Tim's latest, with some of my changes (also a TP suggestion) added:
instead of testing whether the list changed size after each
comparison, temporarily set the type of the list to an immutable list
type. This should allow continued use of the list for legitimate
purposes but disallows all operations that can change it in any way.
(Changes to the internals of list items are not caught, of cause;
that's not possible to detect, and it's not necessary to protect the
sort code, either.)
Guido van Rossum [Mon, 15 Jun 1998 18:01:34 +0000 (18:01 +0000)]
Subject: Bug in PC/import_nt.c
From: Dan Pierson <dan@remote.control.com>
To: "Mark Hammond (E-mail)" <MHammond@skippinet.com.au>,
"Guido van Rossum (E-mail)" <guido@cnri.reston.va.us>
Date: Mon, 8 Jun 1998 17:25:07 -0400
RegistryQueryValue requires that its fourth argument be initialized to
the length of the buffer being passed in, this wasn't being done. I
also split the call and status test into two lines with a local variable
so that I could look at the status in the debugger.
Guido van Rossum [Mon, 15 Jun 1998 18:00:50 +0000 (18:00 +0000)]
Lots of changes to get this in sync with the Frame version.
Added raw strings, imaginary literals, assert and exec (!) keywords, a
table about Resererved classes of identifiers, and more.
Guido van Rossum [Mon, 15 Jun 1998 14:03:52 +0000 (14:03 +0000)]
# Note: a previous checkin message was lost because I can now use CVS
# from my PC at home, but it can't send email :-(
Add a clarifying comment about the new ENTER_OVERLAP and
LEAVE_OVERLAP_TCL macros; get rid of all the bogus tests for deleted
interpreters (Tcl already tests for this; they were left over from an
earlier misguided attempt to fix the threading).
Guido van Rossum [Mon, 15 Jun 1998 04:36:09 +0000 (04:36 +0000)]
# (My first checkin from Windows NT using remote CVS!)
There were some serious problem with the thread-safety code.
The basic problem was that often the result was gotten out of
the Tcl interpreter object after releasing the Tcl lock.
Of course, another thread might have changed the return value
already, and this was indeed happening. (Amazing what trying
it on a different thread implementation does!)
The solution is to grab the Python lock without releasing the
Tcl lock, so it's safe to create a string object or set the
exceptions from the Tcl interpreter. Once that's done, the
Tcl lock is released.
Note that it's now legal to acquire the Python lock while the
the Tcl lock is held; but the reverse is not true: the Python
lock must be released before the Tcl lock is acquired. This
in order to avoid deadlines. Fortunately, there don't seem to
be any problems with this.
Guido van Rossum [Sat, 13 Jun 1998 13:56:28 +0000 (13:56 +0000)]
Fixed the EventHook() code so that it also works on Windows, sort of.
(The "sort of" is because it uses kbhit() to detect that the user
starts typing, and then no events are processed until they hit
return.)
Also fixed a nasty locking bug: EventHook() is called without the Tcl
lock set, so it can't use the ENTER_PYTHON and LEAVE_PYTHON macros,
which manipulate both the Python and the Tcl lock. I now only acquire
and release the Python lock.
Guido van Rossum [Fri, 12 Jun 1998 19:42:14 +0000 (19:42 +0000)]
In completer(), return None instead of raising an IndexError when
there are no more completions left. (This for compatibility with
Donald Beaudry's code.)
Guido van Rossum [Fri, 12 Jun 1998 14:26:18 +0000 (14:26 +0000)]
In tcsetattr(), first initialize the mode structure by calling
tcgetattr(). This seems to be the only correct way to cope with
platform-specific structure members...