Canceling/interrupting raw_input

2005-04-17 Thread J. W. McCall
I'm working on a MUD server and I have a thread that gets keyboard input so that you can enter commands from the command line while it's in its main server loop. Everything works fine except that if a player enters the 'shutdown' command, everything shuts down, but the input thread is still si

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
Bengt Richter wrote: > On 17 Apr 2005 09:27:34 -0700, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > >> Exactly. Except the above example is from the day-old-bread > >items-tuple-returning version of :: ;-) > >> And with an ordered dict subtype there is no need for the generator > >expression either

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
Steven Bethard wrote: > So the object of a "where" is then always an ordered dict? Yes. > If so, then > I guess I like this proposal best so far. > > However, it does seem to have the problem that you can't have any > additional local variables so, for example, list comprehensions are > probably

Re: pre-PEP: Suite-Based Keywords

2005-04-17 Thread Shane Hathaway
Brian Sabbey wrote: > Maybe using '**' would be better than '...' since it already is used to > indicate keyword arguments. Example: > > class C(object): > x = property(**): >doc = "I'm the 'x' property." >def fget(self): > return self.__x >def fset(self, val

Re: Slight discrepancy with filecmp.cmp

2005-04-17 Thread John Machin
On Sun, 17 Apr 2005 22:06:04 -0600, Ivan Van Laningham <[EMAIL PROTECTED]> wrote: [snip] > So I wrote a set of >programs to both index the disk versions with the cd versions, and to >compare, using filecmp.cmp(), the cd and disk version. Works fine. >Turned up several dozen files that had been in

Re: Canceling/interrupting raw_input

2005-04-17 Thread Daniel Cer
For what it's worth, this looks like a Windows specific problem. The code below seems to work as expected on a Linux box. That is, everything terminates, including the "inputLoop", after sys.exit() is called, without the user needing to press 'enter' one last time. However, if I try to run the c

Re: variables exist

2005-04-17 Thread Peter Otten
Michael J. Fromberger wrote: > Would the following be a satisfactory implementation? > > def isset(varname, lloc = locals()): > return varname in lloc or varname in globals() > > I believe this works as desired: > > >>> x = 5 > >>> def f(y): > ... z = 10 > ... print isset('z')

<    1   2