Re: Complementary language?

2004-12-27 Thread Donn Cave
age for software development. Not a gem, but not a toy. Someone who already has Objective CAML and Python on hand might be interested in Felix, http://felix.sourceforge.net. I haven't actually used it, and for all I know it fails my utility test since it is not a very mature language, but I mention in in case anyone is interested in what the author of the "vyper" Python implementation is up to these days. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: argument type

2004-12-27 Thread Donn Cave
point the way to great programming models. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Stylistic question about inheritance

2005-03-31 Thread Donn Cave
functionality, or when they are conceptually related in ways that might lead > to shared functionality later? No -- inheritance is for implementation, not to express conceptual relationship. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: boring the reader to death (wasRe: Lambda: the Ultimate DesignFlaw

2005-04-02 Thread Donn Cave
Quoth Scott David Daniels <[EMAIL PROTECTED]>: | Sunnan wrote: | > ...Because what is "boring"? The opposite of dense, tense, intense. Utterly | > predictable; it's like the combination of all my prejudices. Even before | > I knew, I thought "Bet Python separates statements from expressions". | |

Re: question about functions

2005-04-14 Thread Donn Cave
ge, and there is a similar way to pass parameters to a function from a tuple. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Determine ip address

2005-04-15 Thread Donn Cave
there is nothing I know of that specifically distinguishes "the" external network. If you want something that reliably finds a network that will be used for a certain type of connection, then the best thing to do is make a connection like that, and inspect the results. The getsockname

Re: Strings and Lists

2005-04-18 Thread Donn Cave
array a = array.array('c', strdata) As I understand it, this object simply contains character data, not a list of 1 character string objects, so it's much more economical to store and examine. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables

2005-04-24 Thread Donn Cave
's a nested sequence, not a linear one. So I'm proposing that Python's = operator is like Haskell's "<-", and "foo = 5" is conceptually like "bind 5 to a lambda with one argument "foo" implementing the rest of the procedure body." The confusion is not because foo needs to be so different, it's that Python "=" is not at all math "=". Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables

2005-04-25 Thread Donn Cave
" means "important to implementors". Cf. my prior post on this. Variables are semantically the same, "=" is different but can be modeled in equational terms with a fairly simple transformation. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: select() on pipe

2005-04-25 Thread Donn Cave
ifd = os.open('test.fifo', os.O_RDONLY) ... while 1: ... data = os.read(fifd, 8192) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Secure FTP

2005-04-27 Thread Donn Cave
know it's purely internal and never supported in Microsoft's own software for any of the client/server protocols that use it elsewhere. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: mbx repair script

2005-04-28 Thread Donn Cave
the NUL characters, you could probably write something. Again, you have to be able to recognize the start of message data (or rather, the first MBX message header line.) If the NULs are gone, this is probably preceded by a series of CRLF ('\r\n'.) Keep track of how much has been writ

Re: mbx repair script: Python vs perl

2005-04-30 Thread Donn Cave
rary to do this, but more to the point it isn't what you want to do, with a damaged file. Just read the file from one end to the other and find everything that looks like a header line, and then rewrite the file with adjusted header lines required so that - they are in ascending order by ID n

Re: OO in Python? ^^

2005-12-12 Thread Donn Cave
man from Chalmers. You're right that addition is polymorphic, but that doesn't mean that it can be performed on any two instances of Num. I had constructed a test something like that to check my thinking, but it turns out that Haskell was able to interpret "1" as Double

Re: OO in Python? ^^

2005-12-12 Thread Donn Cave
ed expressions instead of series of statements - so maybe it's not surprising if the layout notation can be more complex. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: executing a system command from my Python app

2005-12-13 Thread Donn Cave
that the expression that appears there on the right hand side of % is not and will never be a tuple, then the (a,) one-tuple is unnecessary. If you aren't sure, it _is_ necessary. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-14 Thread Donn Cave
;] foldr (++) [] [[1, 2, 3], [4, 4, 4]] Really, this kind of abstraction of data types is not only well supported in Haskell, it can be almost a curse, at least for someone like myself who has fairly superficial experience with this kind of programming. After all the functions have been zealo

Re: IsString

2005-12-14 Thread Donn Cave
ons, I suppose, whether that's really a good idea, since there's no question that some understanding of the principles involved has to come fairly early. But I think we really lose out when we try to make it be about the words - "Python doesn't have variables"/"Does too", "Python passes by value"/"Does not", etc. When the words really clearly express the right thing to anyone with a reasonable background, that's great. But usually, they don't. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: IsString

2005-12-14 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: | Donn Cave <[EMAIL PROTECTED]> writes: ... |> Historically, the way I remember it, there was a time not too |> long ago when GvR and his minions sort of dismissed the idea |> that you needed to understand the reference/object model from |

Re: Haskell Typeclasses (was Re: OO in Python? ^^)

2005-12-15 Thread Donn Cave
higher up in the application hierarchy. That might be an interesting philosophical question, as a contrast between the basic world views of FP versus OOP, but of course you'd want to check it with someone with a lot more Haskell than I have. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Interprocess communication and memory mapping

2005-12-15 Thread Donn Cave
f so, how do I avoid the problem of > wasting extra memory by having all of the children processes hold all > of the data in memory as well? Pipes might likely be a better idea, but a lot depends on the design. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: IsString

2005-12-15 Thread Donn Cave
rives as a parameter with its properties unchanged, so obviously the same semantics obtain. Moreover, thinking about anything in terms of mutability is worse than a waste of time, outside of a few odd cases like dictionary keys. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: SMP, GIL and Threads

2005-12-16 Thread Donn Cave
nking that the processor affinity would essentially serialize execution, so SMP hardware doesn't matter because your threads won't execute concurrently anyway? > Threads most often use Queue.Queue to communicate, precisely because its > operations are guaranteed thread-safe. (

Re: closing stdin, stdout and stderr

2005-12-27 Thread Donn Cave
They're special. I suppose because of internal dependencies - last chance exception handler etc. - they are created without a close function, internally, so close() has no effect. I don't know if it really makes any sense, since anyway one may close the file descriptors directly as

Re: Detecting problems in a forked process

2005-12-29 Thread Donn Cave
, you can set the 'close on exec' flag on the pipe write end file descriptor and make sure no process holds this open but the child fork. See the subprocess module for example code (or just use the subprocess module, if it's supported in the deployed Python version.) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuning a select() loop for os.popen3()

2005-12-30 Thread Donn Cave
should be 1) avoid gratuitous branches in the flow of control, 2) reduce number of state variables that you have to account for, and 3) express your intentions clearly with respect to the timeouts -- what do you do when it times out, and why? Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how to show Chinese Characters in the value set of a dictionary

2006-01-03 Thread Donn Cave
% self.value dict['c1'] = Xtring('...') print dict.values() (Of course you should use unicode instead of string - if you can figure out how to require the default encoding that supports your character set. Python has an unfortunate preference for "ascii" as a de

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Donn Cave
in believers are coming from. People who don't already understand what's being explained, need to have a little patience and make sure to test their understanding with a few experiments. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Donn Cave
role in programming (or mathematics), a thing whose value may vary according to the logic of the program. C and FORTRAN don't own this word, and it isn't just their version against the way Python and some other languages do it. Each language has its own angle on it, and they're all going to be called variables. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-05 Thread Donn Cave
arrot what was said in the > past with no concern for the consequences of what we say? The latter. I know this from the number of times I have read that parameter passing has something to do with whether the parameter is a mutable or immutable object. Donn Cave, [EMAIL PROTECTED] -- h

Re: Is 'everything' a refrence or isn't it?

2006-01-06 Thread Donn Cave
*/ } Maybe the cure for hardened C programmers who aren't getting it is to emphasize the pointer angle - and note that there isn't any way to write "*i = 4". "Everything is a pointer", let's say -- or maybe, "Everything is a reference" would be

Re: Is 'everything' a refrence or isn't it?

2006-01-08 Thread Donn Cave
rite some software, and if we dive in without understanding, our attempts will be plagued with conceptual errors. Is there something about value in particular that seems to be a problem here? ``No, you idiot, that's not a value - THIS is a value!'' Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: thread hangs when using subprocess only in specific circumstances

2006-01-09 Thread Donn Cave
not subprocess, no problem (I can use os.popen, or os.pipe/fork/execve, etc.) I imagine this is related to the problem on Linux. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-10 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > "Donn Cave" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] ... > > So you've had time to think about how you would define value, in a > > few words. Any ideas? > > Not y

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Donn Cave
#x27;t a simple problem. It isn't, in principle, it's a huge bucket of worms. But if you have a practical focus that comes out of your actual application for this function, it could be pretty trivial. Your choice, and likewise for the notion of value in general. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Donn Cave
straints on how you may use these namespaces. You can use an instance, or a class, like you would use a dictionary object, and then it's all value. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Donn Cave
nably object that "the same" ought to account for all properties of a value, and not just equality. The issue doesn't seem to come up when writing programs, though, in my experience. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Donn Cave
ess True' else: print 'evidently not' None doesn't follow the default, so it seems like "if" has discovered some sort of value in there. (But of course in any case, whether this is a value or not a value, the value of the question is certainly in question.) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutable bytes type

2006-01-16 Thread Donn Cave
m[1] = 'h' print m, [m] I probably left out a few methods you would want. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Donn Cave
thon was really a simple language. So this belongs in a different category from, say, lists and dicts as default arguments. That is a natural usage, where __eq__ is sort of a perversion if you will, and a Python programmer should know about it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Donn Cave
had, that is so valid, is that it is futile to talk about value, per se. Changing the word you use will do nothing to improve this. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Claudio Grondi <[EMAIL PROTECTED]> wrote: > Donn Cave wrote: ... > > exactly, "value". The realization you just had, that is so valid, > > is that it is futile to talk about value, per se. Changing the > > word you use

Re: Problem with running external process

2006-01-20 Thread Donn Cave
ot sure what's causing this. I suggest you invoke "ps" after a hundred iterations or so - maybe "ps -ef", or "ps wwaux" on BSD platforms like MacOS. I think the output may show a large number of processes, and you will know where they came from. Donn C

Re: How to lock files (the easiest/best way)?

2006-07-17 Thread Donn Cave
ou've immediately created it too. > > > > Sybren > > Thanks. Is that what atomic basically means? Yes, and also "race condition". That's why Jim Segrave's example code uses O_EXCL with open(2). Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-17 Thread Donn Cave
matters like this should follow the underlying point of the code. In this case, the body of the test refers implicitly to the length of the list, since .pop() -> (list[a], list[:a]) where a is (len(list) - 1) It's therefore quite appropriate for the test to be length. Donn Cave, [

Re: Coding style

2006-07-18 Thread Donn Cave
Yes, it's clearly more direct to catch IndexError, than to try to anticipate it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-19 Thread Donn Cave
oogle.com/group/comp.lang.python/msg/2de5e1c8384c0360 It's lengthy but very readable, and for me it has that quality of exposition where you feel at first reading as though you had already known all that -- even if you really hadn't. But I don't know where she is today, or the P

Re: Depricated String Functions in Python

2006-07-20 Thread Donn Cave
x27;] Oh, excellent - the string module is dead, long live the string module! I can replace string.join with str.join, and never have to defile my code with that ' '.join(x) abomination. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-20 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2006-07-19, Donn Cave <[EMAIL PROTECTED]> wrote: ... > > http://groups.google.com/group/comp.lang.python/msg/2de5e1c8384c0360 > > > > It's lengthy but very readable, and

Re: Python open a named pipe == hanging?

2006-08-04 Thread Donn Cave
tmpfile2').read() > > But that's kinda awkward isn't it? :-) The Bash way of doing this > would be (suppose A is the stdout of prog2, B is the stdout of > prog3): > > diff <(prog2) <(prog3) > C > > What is the best way of doing this i

Re: Python open a named pipe == hanging?

2006-08-04 Thread Donn Cave
ackground process; did it occur to you to try that in Python? > Anyway, I think every scripting language has its pros and cons. Bash is > probably more flexible in dealing with fifos and multiway pipes (through > the magic menchanism of process substitution). Multiway pipes? Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python open a named pipe == hanging?

2006-08-07 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > Donn Cave <[EMAIL PROTECTED]> wrote: > > > In article <[EMAIL PROTECTED]>, > > Rochester <[EMAIL PROTECTED]> wrote: > > > > > I just found out that the gene

Re: Python open a named pipe == hanging?

2006-08-08 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > Donn Cave <[EMAIL PROTECTED]> wrote: >... > > > > I believe your problem is that, by the time you open the > > > > pipe for read, it has already been closed by its writer.

Re: Make Object Oriented?

2006-08-10 Thread Donn Cave
e class, and which should it keep local? What criteria might it > use for making such a choice? How could you be sure that the decisions > it made would be useful or appropriate? Yes indeed. This must be OO fever in its most rarified form - the notion that even mechanical conversion to

Re: using mmap on large (> 2 Gig) files

2006-10-24 Thread Donn Cave
; rather, it just opens a file in > the file system and uses fseek to move around. Wow, you're sure a wizard! Most people would need to look before making statements like that. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining SSL certificate info from SSL object - BUG?

2006-10-24 Thread Donn Cave
there will be no values that include / in a context like really looks like that X.500 style distinguished name. So if you parse out that string in those terms, and require each of those key = value pairs to have reasonable values - key has no embedded spaces, value has non-zero length - then you should be OK. Re-join any invalid component to its predecessor's value. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-25 Thread Donn Cave
hat "if s == True", where s is not a boolean object, might represent a gain in readability. That really redefines readability. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-26 Thread Donn Cave
"if" -- well, we just have to use what we have. If there were better words to use with the notion of "something-ness", I think we would see booleans as a silly thing of little use to Python programmers. If you can see "if" and "while" as constructs that respond to something-ness, you will appreciate idiomatic Python better, because that arguably is just what it's about. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: question about True values

2006-10-27 Thread Donn Cave
hat "if" and "while" are asking for "yes" and "no", instead of "true" and "false", and ask yourself if we have the philosophical problems with "yes" that we do with "true". Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: os.chdir doesn't accept variables sometimes

2006-06-02 Thread Donn Cave
ing like find . -name \*.mp3 -exec $HOME/bin/cvt .mp4 {} \; where cvt would be something like #!/bin/sh case $1:$2 in .mp4:*.mp3) mp3_to_mp4 $2 ${2%.mp3}.mp4 ;; ... You'd have to think about it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Select hangs after some reads

2006-06-08 Thread Donn Cave
ocol traffic, and I don't remember needing to do any such thing there. I'd have to look harder at the details, but as I recall it, like any sane application the protocol is defined in terms of data, so you know if you have a complete command by looking at what you have. Donn Cave,

Re: References and copying

2006-06-09 Thread Donn Cave
6915448 > >>> id(a[1]) > 46912496915448 > >>> You're right - he actually didn't set the name b to reference a slice of a. But if he had - slicing a list does return a new list. Indexing, as in the example, returns the item object. Or, binds a reference to

Re: eval(repr(object)) hardly ever works

2006-09-13 Thread Donn Cave
e possible ... but then the documentation for __str__ right below it says "differs from __repr() in that it does not have to be a valid Python expression". There's plenty of evidence in the standard libraries that people understand these two functions, but they certainly have arrived at that understanding from some other route than reading the documentation. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about pipes/os.popen

2006-09-15 Thread Donn Cave
shell commands. Not that it strictly couldn't be done, but on the whole I haven't noticed that anyone cares. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: commands.getstatusoutput result is not command line exit value!!!

2006-10-02 Thread Donn Cave
(and os.WIFEXITED.) Not only does this do more precisely the right thing, it will work on any platform that supports a POSIX wait -- which doesn't require that exit == status << 8, only that WEXITSTATUS be able to return that value. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with imaplib (weird result if mailbox contains a %)

2006-11-30 Thread Donn Cave
cpapen/newsletters % > * LIST (\HasNoChildren) "/" "user/cpapen/organisatie &- structuur" > * LIST (\HasNoChildren) "/" "user/cpapen/sociale wetenschappen" {5}\r\nhello\r\n is an IMAP "literal". It's unlucky that Cyrus uses this for

Re: Non-blocking pipes during subprocess handling

2007-01-09 Thread Donn Cave
l throw the select off. From memory - better check, since it has been a while since I wrote anything real like this (or for that matter much of anything in Python) -- import select def ProcessOutput(instream, outstream): fdr = [instream.fileno()] (r, w, e) = select.select(fdr, [], [], 0.0)

Re: Problem with running external process

2006-01-24 Thread Donn Cave
ANG) No, do you see them doing it? "Check if the previous child process is done?" In your original post you said you were using os.P_WAIT, but I suppose you really were using os.P_NOWAIT all along, right? This case may call for a working sample program that makes a genuine attempt t

Re: writing large files quickly

2006-01-27 Thread Donn Cave
never written are virtual blocks, inasmuch as read() at that location will cause the filesystem to return a block of NULs. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-29 Thread Donn Cave
ho tells you that there's nothing about the language that encourages hard-to-read code. Give people a feature like this, and they will find a need for it, to the detriment of comprehensibility. I'm not saying that we should therefore use C++ !, but let's be realistic about the costs of Python's benefits. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs C for a mail server

2006-01-29 Thread Donn Cave
disingenuous to me to make this argument, frankly. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Authenticating to Kerberos

2006-01-30 Thread Donn Cave
eds(), where the caller uses the TGT to get a host service ticket, but I guess you could use GSS ftp or something, anything that uses the TGT. Otherwise, an attacker can pose as the KDC while logging in, and give you a TGT regardless of what password was typed in. Of course such a TGT won't wo

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
In article <[EMAIL PROTECTED]>, ... > Granted, it is a pain to change type declarations. I see it is time for the bi-monthly reminder that C++ is not the ideal example of strong static typing, unless you just want to make it look bad. Cf. Hindley-Milner type inference. Donn Cav

Re: Python vs C for a mail server

2006-02-01 Thread Donn Cave
text should be about whether you can test everything, whether types convey semantics, etc. Let us forget about whether explicit typing is too much overhead, since it isn't required in principle. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-02 Thread Donn Cave
def bar(self, a, b): return a + b bar(Foo(), 1, 2) => 3 The virtues of this consistency become more apparent in a more complex functional context: sys.stdin.write(open(file, 'r').read().split(sep)[0]) vs. write(sys.stdin, split(read(open(file, 'r')))[0]) Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-02 Thread Donn Cave
The current call syntax at least can be read from left-to-right, and > you always know whether you call a member function or a global one. That's exactly the problem, it doesn't read from left to right, because we swap back and forth between function(parameter and parameter.function notation. It only works if you don't have to mix the two. I'm saying, pick one and use it consistently. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-03 Thread Donn Cave
in the current scope. But current scope is actually a compound lookup - function scope, global scope etc. Generalize it to object scope, and then you can have a notation that expresses these things consistently - QED. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-03 Thread Donn Cave
his, Haskell's typeclass mechanism, and there is a ``multiple dispatch'' model that I have no experience with but is not without its supporters. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Another try at Python's selfishness

2006-02-04 Thread Donn Cave
o be seriously considered, someone would be hot to extend it to multiple objects before it even got implemented on one, but in any case, single dispatch sounds like just a restricted case of multiple dispatch, so if the latter is feasible, so is the former. I've heard talk about a form of static

Re: how to kill a python process?

2006-02-06 Thread Donn Cave
n/python', ['test1', '/tmp/test1'], os.environ) $ ps wwaux | fgrep test1 donn 227 ... 1568 p1 S 9:30AM 0:00.19 test1 /tmp/test1 (instead of normal) os.execve('/usr/bin/python', ['python', '/tmp/test1'], os.environ) You ca

Re: how to kill a python process?

2006-02-06 Thread Donn Cave
I described. That's something I expect to be standard > operating procedure on any Unix (although I haven't spent much time outside > Linux recently). Does it depend on the question? If you have been checking this with "ps", try "ps -f". There seem to be a

Re: Replacing curses

2006-02-08 Thread Donn Cave
nt > variables for locale, etc.). > > xterm's terminfo lists a lot of function keys, for instance. This is just my opinion, but any application that depends on function keys in terminfo is broken, automatically. Optional support for function keys is a nice touch, but the data isn't good enough out there to depend on it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of finding terminal width/height?

2006-02-09 Thread Donn Cave
> you'll continue to get an EOF forever. They were probably thinking of the way the UNIX tty driver delivers an EOF on D, after which of course you can continue to read data from the same tty. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython socket typecasting problems

2006-02-11 Thread Donn Cave
venient but hides this step of the process. Maybe 'localhost' actually doesn't resolve on the original poster's computer, and the implementation somehow turns this into a type issue. If it does resolve, then maybe its IP address will work better here. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython socket typecasting problems

2006-02-13 Thread Donn Cave
rned that there is no such > thing as explicit typecasting. What to do? If I understand what you're doing there, it seems to confirm that when this socket implementation encounters an error in a network address, during connect(), it raises a type error. The thing to do, therefore, is expect TypeError, where in C Python you would expect a socket.gaierror or socket.error (in older versions) exception. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Donn Cave
her way without ambiguity. Or we could, anyway, if everyone else would get with it. If you're going to adopt this sensible program, other short vowel words are roof, hoof, creek. My grandfather pronounced hoop short, but I never heard anyone else do likewise. Tuple rhymes with couple. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: is socket thread safe?

2006-02-15 Thread Donn Cave
. I have seen socket implementations where it didn't, though - the read would end as if interrupted by a signal. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run shell commands within python

2006-02-16 Thread Donn Cave
uot; with os.rename() if you don't care that it will fail when the destination is on a different filesystem. Etc. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing python on lynxOS

2006-02-16 Thread Donn Cave
what would be appropriate - maybe it was put inside WITH_THREAD in error, in the first place, for all I know. If you think you probably should be getting threads, then look at pyconfig.h to verify this. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: A way to discover PIDs of child processes?

2006-02-17 Thread Donn Cave
ommand. If it's the last thing the shell has to do, then it can be exec'ed without a fork, which leaves the gdb image running in the immediate child process. Some shells do that automatically. In any case, a Bourne shell "exec" statement will do it, like "exec /.../gdb

Re: Exiting os.spawnv's subroutine

2006-02-17 Thread Donn Cave
guous, but my guess is your process just isn't done when you think it is. It's flushing data to disk or something like that. Or it could be something else. Why don't you write a sample program that works like this, and demonstrates the problem, and then we'll know. Donn Cav

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Donn Cave
", but not "Python is a scripting language!", since its place in the taxonomy of languages would be somewhere else. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Donn Cave
ial Python users. The most obvious to me is that your Python program essential includes its interpreter - can't go anywhere without it, and any change to the interpreter is a change to the program. There are various strategies to address this, but pretending that Python isn't interpreted is not one of them. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: why does close() fail miserably on popen with exit code -1 ?!

2006-02-20 Thread Donn Cave
ings (which is what '-1' would have been with the classic UNIX shell.) So I will leave it to someone else to wrestle with the Microsoft problem, but I just wanted to point out that it isn't something you could expect to work anywhere else. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Donn Cave
exity. I guess this is why for some people, "scripting language" just means "interpreted and suited to writing trivial programs." It's hard to believe they're thinking very hard about what they're saying, but so what's new? Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Donn Cave
ingers and hope that I have the required Python interpreter version, slip in a 25Mb Python interpreter install and hope I won't notice, or come clean and tell me that your program needs an interpreter and I should check to see that I have it. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-21 Thread Donn Cave
e that starts with "No of course not", even omits a point that everyone understands, you can in fact expect a .py file will work independent of machine architecture - like any interpreted language. We all know what native code compilation buys you and what it doesn't. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-21 Thread Donn Cave
/j-native.html?loc=j - which seems like it might be of some interest here. My impression from reading this is that Java actually can be compiled to native code, though in 2002 this was relatively new. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to build python without 'posixmodule' ?

2006-02-21 Thread Donn Cave
m that? Look for a recent thread here about porting Python to LynxOS. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Donn Cave
interest in computer programming is likely to know what microcode means, that there are emulators, virtual machines, etc. You might find the UCSD Pascal system interesting, to harken back to the early days of my experience with computers, a fascinating twist on the interpreted/compiled story. Intere

<    1   2   3   >