Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
Mike Meyer wrote: If it's not a wart, why would it be a wart for user-defined types to have the same behaviour? It's a wart because user-defined classes *don't* have the same behavior. Then *my* solution for this would be to give user-defined classes a way to behave like builtins, eg.

Re: Making immutable instances

2005-11-24 Thread Giovanni Bajo
Mike wrote: How can a (user-defined) class ensure that its instances are immutable, like an int or a tuple, without inheriting from those types? What caveats should be observed in making immutable instances? IMHO, this is usually (but not always) a mistake. (If you're programming a missle

Software keyboard

2005-11-24 Thread maxxx_77
Hello. I'm a newbye of Python. I'm looking for a way of coding a virtual keyboard similar to the one that comes with Windows (Accessories - Accessibility - On Screen Keyboard). What I would like to do is make one which is a lot larger and add transparency to it. I've a first version in which I

Re: the PHP ternary operator equivalent on Python

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I don't find your code any more readable than the OP's equivalent code: the OP's question was How you do this in a practic way without the use of one-line code ? The OPs code make one pass through the dict, your's makes two. I do not know what effect (if

Re: wxPython Licence vs GPL

2005-11-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: Steve Holden wrote: Whether or not some fragments of code remain unchanged at the end of your project, if you start out with a piece of source code lifted from wxPython then what you have created is definitely a derivative work and, as such, you must take into account

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Fredrik Lundh wrote: performance is of course another aspect; if you *need* two parallel lists, creating a list full of tuples just to pull them apart and throw them all away isn't exactly the most efficient way to do things. (if performance didn't matter at

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: Steve Holden wrote: Whether or not some fragments of code remain unchanged at the end of your project, if you start out with a piece of source code lifted from wxPython then what you have created is definitely a derivative work and, as such, you

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: performance is of course another aspect; if you *need* two parallel lists, creating a list full of tuples just to pull them apart and throw them all away isn't exactly the most efficient way to do things. (if

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
Alex Martelli wrote: Fuzzyman [EMAIL PROTECTED] wrote: ... - the internal keys list should be hidden I disagree. It is exposed so that you can manually change the order (e.g. to create a sorted dict, rather than one ordered by key insertion). What do you *gain* by hiding it ?

Re: 2.4.2 on AIX fails compiling _codecs_cn.c

2005-11-24 Thread Martin v. Löwis
Paul Watson wrote: It appears that _ALL_SOURCE gets defined in the /usr/include/standards.h file. If we could #define _ANSI_C_SOURCE or _POSIX_SOURCE, it appears that it would eleminate _ALL_SOURCE. Ah, ok - this should be easy enough. Python would normally define _POSIX_SOURCE (through

Re: return in loop for ?

2005-11-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: Steve Holden wrote: Yomgui: I am not a language lawyer, but I think you can feel safe returning from inside a loop. Just as a matter of interest, how else would you propose to implement the functionality Mike showed: def f(): ... for i in range(20): ... if i

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: the thing that's in favour is then-if-else, not if-then-else. Sorry if I confused you, I though it was clear that I meant the concept, not a specific syntactical implementation. yup, but if you care readability about, the words order appear in would to seem matter

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
Ok. That answers a question in the post I've just made. This thread is hard to follow. Thanks Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Steve Holden wrote: Whether or not some fragments of code remain unchanged at the end of your project, if you start out with a piece of source code lifted from wxPython then what you have created is definitely a derivative

Opening for Python Programmers at Japan

2005-11-24 Thread Muralitharan
Hi Members, Kindly forward your resume for the following: Skills: Python Programmers Minimum of 2/3 years of experience Location : Japan Contract: upto 6 months extendable. Forward your resumes to [EMAIL PROTECTED] Thanks Regards, Murali --

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread Antoon Pardon
Op 2005-11-24, Fredrik Lundh schreef [EMAIL PROTECTED]: [EMAIL PROTECTED] wrote: the thing that's in favour is then-if-else, not if-then-else. Sorry if I confused you, I though it was clear that I meant the concept, not a specific syntactical implementation. yup, but if you care

Re: return in loop for ?

2005-11-24 Thread [EMAIL PROTECTED]
Steve Holden wrote: Well, I'm happy in this instance that practicality beats purity, since the above is not only ugly in the extreme it's also far harder to read. What are the claimed advantages for a single exit point? I'd have thought it was pretty obvious the eight-line version you gave

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
Christoph Zwerschke wrote: Fuzzyman wrote: So what do you want returned when you ask for d1[1] ? The member keyed by 1, or the item in position 1 ? In case of conflict, the ordered dictionary should behave like a dictionary, not like a list. So d1[1] should be the member keyed by 1, not

Re: user-defined operators: a very modest proposal

2005-11-24 Thread Antoon Pardon
Op 2005-11-22, [EMAIL PROTECTED] schreef [EMAIL PROTECTED]: * Should some of the unicode mathematical symbols be reserved for literals? It would be greatly preferable to write \u2205 instead of the other proposed empty-set literal notation, {-}. Perhaps nullary operators

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: the thing that's in favour is then-if-else, not if-then-else. Sorry if I confused you, I though it was clear that I meant the concept, not a specific syntactical implementation. yup, but if you care readability about, the words order

Re: wxPython Licence vs GPL

2005-11-24 Thread Steve Holden
Steven D'Aprano wrote: Steve Holden wrote: The thrust of my original remarks was to try to persuade the OP that the original comment about changing the code was ingenuous. If you take some code under license as a starting point then even if no line of code remains unchanged at the end of

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Duncan Booth
Christoph Zwerschke wrote: Duncan Booth schrieb: In Javascript Object properties (often used as an associative array) are defined as unordered although as IE seems to always store them in the order of original insertion it wouldn't surprise me if there are a lot of websites depending on that

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I know that is a single list of tuples, I mean that can be used as well. for k, _ in d.items(): print k for _, v in d.items(): print v for k in d.keys(): print k for v in d.values(): print v Would there be a noticeable performance difference ? Sloppy use of

Re: Making immutable instances

2005-11-24 Thread Alex Martelli
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ... qualification, you're quite likely to get such disclaimers. If you don't want them, learn to ask about stopping your users from ACCIDENTALLY doing X, and no reasonable respondant will fail to notice the qualification. Interestingly, that

Re: Making immutable instances

2005-11-24 Thread [EMAIL PROTECTED]
Alex Martelli wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ... qualification, you're quite likely to get such disclaimers. If you don't want them, learn to ask about stopping your users from ACCIDENTALLY doing X, and no reasonable respondant will fail to notice the

Xah's Edu Corner: Sophie's World

2005-11-24 Thread Xah Lee
Recommended: Sophie's World, by Jostein Gaarder, 1995. http://en.wikipedia.org/wiki/Sophie%27s_World http://www.amazon.com/gp/product/0425152251/ Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Licence vs GPL

2005-11-24 Thread Steven D'Aprano
Steve Holden wrote: The thrust of my original remarks was to try to persuade the OP that the original comment about changing the code was ingenuous. If you take some code under license as a starting point then even if no line of code remains unchanged at the end of the process your code is

Re: Making immutable instances

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: Giovanni Bajo [EMAIL PROTECTED] writes: Mike Meyer wrote: Note that this property of __slots__ is an implementation detail. You can't rely on it working in the future. I don't rely on it. I just want to catch bugs in my code. I certainly hope you're not relying on it

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I know that is a single list of tuples, I mean that can be used as well. for k, _ in d.items(): print k for _, v in d.items(): print v for k in d.keys(): print k for v in d.values(): print v Would there be a noticeable performance

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: I know that is a single list of tuples, I mean that can be used as well. for k, _ in d.items(): print k for _, v in d.items(): print v for k in d.keys(): print k for v in d.values(): print v Would there be a noticeable performance

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread Manlio Perillo
On Thu, 24 Nov 2005 05:22:18 GMT, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 23 Nov 2005 16:51:15 GMT, Manlio Perillo [EMAIL PROTECTED] declaimed the following in comp.lang.python: So, it's seem to be a specific problem of Windows XP(?). Pardon? I think the prior respondent said

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: Consider a dictionary with one million items. The following operations k = d.keys() v = d.values() creates two list objects, while i = d.items() creates just over one million objects. In your equivalent example, you're calling d.items() twice to

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
Giovanni Bajo [EMAIL PROTECTED] writes: Mike Meyer wrote: Note that this property of __slots__ is an implementation detail. You can't rely on it working in the future. I don't rely on it. I just want to catch bugs in my code. I certainly hope you're not relying on it to catch bugs. You should

Re: wxPython Licence vs GPL

2005-11-24 Thread Martin P. Hellwig
Steven D'Aprano wrote: cut I'm FREE to use the software, FREE to redistribute it, FREE to give it away, FREE to make derivative works, FREE to transfer the licence, *and* I got it FREE of cost as well, but that doesn't make it free. Indeed, when I explain GPL to non-techies and what their

Re: best cumulative sum

2005-11-24 Thread Peter Otten
Alan aka David Isaac wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] You are in for a surprise here: You got that right! def empty(): ... for item in []: ... yield item ... bool(empty()) True Ouch. bool(iter([])) True # python

Re: the PHP ternary operator equivalent on Python

2005-11-24 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: Fredrik Lundh wrote: def convert(old): new = dict( CODE=old['CODEDATA'], DATE=old['DATE'] ) if old['CONTACTTYPE'] == 2: new['CONTACT'] = old['FIRSTCONTACT'] else: new['CONTACT'] = old['SECONDCONTACT'] return

Re: return in loop for ?

2005-11-24 Thread Duncan Booth
Steve Holden wrote: Interestingly, I just saw a thread over at TurboGears(or is it this group, I forgot) about this multiple return issue and there are people who religiously believe that a function can have only one exit point. def f(): r = None for i in range(20): if i 10:

Re: Converting a flat list to a list of tuples

2005-11-24 Thread Bengt Richter
On Wed, 23 Nov 2005 13:23:21 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: Bengt Richter wrote: Are you thinking of something like lines from a file, where there might be chunky buffering? ISTM that wouldn't matter if the same next method was called. Here we have multiple references to the

Re: return in loop for ?

2005-11-24 Thread [EMAIL PROTECTED]
Duncan Booth wrote: To bonono, not Steve: So if a function should religiously have only one exit point why does the example you give have two exit points? i.e. the 'return r', and the implied 'return None' if you execute the 'something' branch. I may have remember it wrong, but don't ask me.

Re: Python as Guido Intended

2005-11-24 Thread Ben Sizer
[EMAIL PROTECTED] wrote: Steve Holden wrote: I agree that sometimes those who shoot such proposals down in flames might be more considerate of the feelings of the proposers, but life is short and we are all imperfect. Well, no one is obliged to be considerate about other's feeling, that

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread Fredrik Lundh
Manlio Perillo wrote: I have added a question mark... However: did you have installed SP1 or SP2? running XP without service packs is a really bad idea. you're not telling me that you haven't updated, are you? (the machines I tested on are all fully up to date) /F --

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Duncan Booth
[EMAIL PROTECTED] wrote: Consider a dictionary with one million items. The following operations k = d.keys() v = d.values() creates two list objects, while i = d.items() creates just over one million objects. In your equivalent example, Sorry. I lose you here. Could you

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Duncan Booth
[EMAIL PROTECTED] wrote: As for the (k,v) vs (v,k), I still don't think it is a good example. I can always use index to access the tuple elements and most other functions expect the first element to be the key. For example : a=d.items() do something about a b = dict(a) But using the

Re: a new design pattern for Python Library?

2005-11-24 Thread Ben Sizer
The Eternal Squire wrote: Suppose I have a central class with complex behavior that I want to simply write as a bare skeleton upon which to hang the auxillary classes that help provide the complex behavior. So, it's akin to the GoF's Template Method or Strategy patterns, then. What I will

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread Manlio Perillo
On Thu, 24 Nov 2005 10:24:02 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: Manlio Perillo wrote: I have added a question mark... However: did you have installed SP1 or SP2? running XP without service packs is a really bad idea. you're not telling me that you haven't updated, are you? I

Re: Python as Guido Intended

2005-11-24 Thread Antoon Pardon
Op 2005-11-23, [EMAIL PROTECTED] schreef [EMAIL PROTECTED]: My own experience with adapting to Guido's design-view relates to tuples and lists. To Guido, tuples are for records and lists are for iteration. My own inclination is to view tuples as immutable lists. Accordingly, it seems obvious

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
Carsten Haese wrote: On Wed, 23 Nov 2005 23:39:22 +0100, Christoph Zwerschke wrote Carsten Haese schrieb: Thus quoth the Zen of Python: Explicit is better than implicit. In the face of ambiguity, refuse the temptation to guess. With those in mind, since an odict behaves mostly

Re: return in loop for ?

2005-11-24 Thread Neil Hodgson
Steve Holden: What are the claimed advantages for a single exit point? I'd have thought it was pretty obvious the eight-line version you gave is far more likely to contain errors than Mike's three-line version, wouldn't you agree? Single exit point is an ancient Dijkstraism. It was

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: creates just over one million objects. In your equivalent example, you're calling d.items() twice to produce two million objects, none of which you really care about. This is what I get from the doc : a.items() a copy of a's list of (key, value) pairs (3)

Re: return in loop for ?

2005-11-24 Thread Fredrik Lundh
Neil Hodgson wrote: Yes, the rule has obvious shortcomings, but OTOH if it had enabled reasonable formal verification... I somehow find it hard to believe that you could write a multi-exit function that cannot be trivially and automatically converted to a single-exit function, for further

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
On 24 Nov 2005 10:21:51 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: But only Guido, thinks like Guido and then even Guido may now think differently than he thought before. And what if Guido had a bad day when he came up with something, should we just adopt to what he had in mind without

Re: Opening for Python Programmers at Japan

2005-11-24 Thread Fuzzyman
I'll do the job from the UK for you. ;-) Fuzzyman http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: about sort and dictionary

2005-11-24 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: do things right is my fundamental beef with Python. Dispite claims, I don't believe Python's designers have a monopoly on the definition of right. This hammer is stupid. It's very uncomfortable, and it's not hard and heavy enough to get the nails into the wall. It

Re: about sort and dictionary

2005-11-24 Thread Magnus Lycka
Alex Martelli wrote: I think you mean volatile or mutable rather than transient? transient is not a keyword in C++, while both volatile and mutable are, with different semantics. Anyway, C++'s 'const' is a mess both theoretical AND practical. I'm told Ruby's object-freezing works better

Re: return in loop for ?

2005-11-24 Thread Steve Holden
Fredrik Lundh wrote: Neil Hodgson wrote: Yes, the rule has obvious shortcomings, but OTOH if it had enabled reasonable formal verification... I somehow find it hard to believe that you could write a multi-exit function that cannot be trivially and automatically converted to a

Re: Python as Guido Intended

2005-11-24 Thread Antoon Pardon
Op 2005-11-24, Mike Meyer schreef [EMAIL PROTECTED]: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Mike Meyer wrote: I do think that the Python development community believes they do, or more accurately, that if someone wants to use a different style, they can go use something else. In

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread Bengt Richter
On Wed, 23 Nov 2005 18:18:34 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: Manlio Perillo wrote: print data Traceback (most recent call last): File xxx, line xxx, in ? print data IOError: [Errno 12] Not enough space errno 12 is ENOMEM (that is, the system did not have enough

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: These results make more sense. However, I am still puzzled : 1. why would d.keys()/d.values() only return one list element ? Why isn't it a list of 1M element of either the keys or values but items() is ? keys returns a single list object which contains references

Re: defining the behavior of zip(it, it) (WAS: Converting a flatlist...)

2005-11-24 Thread Bengt Richter
On Wed, 23 Nov 2005 17:55:35 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: so how equivalent must something be to be equivalent? quack, quack? ;-) Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread [EMAIL PROTECTED]
Bengt Richter wrote: If windows has been running a long time (a few days or a week may be long ;-) it may get fragmented in some smallish memory arena reserved for special things (I forgot what versions, but I wouldn't be surprised if something still had s specialized limit). I know it

Re: return in loop for ?

2005-11-24 Thread Steven D'Aprano
On Thu, 24 Nov 2005 11:06:58 +, Steve Holden wrote: Besides which I'm somewhat sceptical about formal verification methods. While outwardly they apear to offer a technique for making software more reliable there are two shortcomings I'm leery of. First, no verification program can

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: These results make more sense. However, I am still puzzled : 1. why would d.keys()/d.values() only return one list element ? Why isn't it a list of 1M element of either the keys or values but items() is ? keys returns a single list

Re: wxPython Licence vs GPL

2005-11-24 Thread Steven D'Aprano
On Thu, 24 Nov 2005 00:26:36 -0800, [EMAIL PROTECTED] wrote: As for the liability, that is for sure, withness what is happening for the linux kernel. What is happening for the Linux kernel? -- Steven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as Guido Intended

2005-11-24 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: When we notice that people are fighting the language, sometimes the best approach is to change the language so that there is less reason to fight the language. I think just don't disregard the other side without considering their rationale is enough, and I mean the other

Writing big XML files where beginning depends on end.

2005-11-24 Thread Magnus Lycka
We're using DOM to create XML files that describes fairly complex calculations. The XML is structured as a big tree, where elements in the beginning have values that depend on other values further down in the tree. Imagine something like below, but much bigger and much more complex: node sum=15

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: creates just over one million objects. In your equivalent example, you're calling d.items() twice to produce two million objects, none of which you really care about. This is what I get from the doc : a.items() a copy of a's list of

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Piet van Oostrum
Christoph Zwerschke [EMAIL PROTECTED] (CZ) escribió: CZ Eso es exactamente lo que yo queria haber! ¿Haber? ¿Tener? :=( -- Piet van Oostrum [EMAIL PROTECTED] URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] --

Python Midi Package: writing events non-chronologically

2005-11-24 Thread tim
Someone using Python Midi Package from http://www.mxm.dk/products/public/ lately? I want to do the following : write some note events in a midi file then after doing that, put some controllers at the beginning of the midifile (because I want to be able to make those dependant on what notes were

Re: Python as Guido Intended

2005-11-24 Thread Antoon Pardon
Op 2005-11-24, Simon Brunning schreef [EMAIL PROTECTED]: On 24 Nov 2005 10:21:51 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: But only Guido, thinks like Guido and then even Guido may now think differently than he thought before. And what if Guido had a bad day when he came up with something,

Re: return in loop for ?

2005-11-24 Thread Fredrik Lundh
Steve Holden wrote: sepcifications did you mean: sceptifications ? (otoh, with 11,100 google hits, sepcifications should probably be considered as a fully acceptable alternate spelling ;-) /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
By the way, Nicola and I will be working on an improving odict in line with several of the suggestions in this thread. See : http://www.voidspace.org.uk/python/weblog/arch_d7_2005_11_19.shtml#e140 All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml --

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
On 24 Nov 2005 11:30:04 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: But he's consistently a better judge of language design than I am, and in all likelihood better than you, too. If you like Python, it's 'cos you like the decisions he's made over many years. So, that makes that about a

Re: wxPython Licence vs GPL

2005-11-24 Thread Peter Hansen
Steven D'Aprano wrote: On Thu, 24 Nov 2005 00:26:36 -0800, [EMAIL PROTECTED] wrote: As for the liability, that is for sure, withness what is happening for the linux kernel. What is happening for the Linux kernel? The confidence of some of its (potential? gullible?) users in their ability to

Re: return in loop for ?

2005-11-24 Thread Duncan Booth
Steven D'Aprano wrote: While outwardly they apear to offer a technique for making software more reliable there are two shortcomings I'm leery of. First, no verification program can verify itself; That's not a problem if there exists a verification program A which can't verify itself but

Re: wxPython Licence vs GPL

2005-11-24 Thread [EMAIL PROTECTED]
Peter Hansen wrote: Steven D'Aprano wrote: On Thu, 24 Nov 2005 00:26:36 -0800, [EMAIL PROTECTED] wrote: As for the liability, that is for sure, withness what is happening for the linux kernel. What is happening for the Linux kernel? The confidence of some of its (potential? gullible?)

Re: return in loop for ?

2005-11-24 Thread Peter Hansen
Duncan Booth wrote: In practice it is impossible to write code in Python (or most languages) with only one return point from a function: any line could throw an exception which is effectively another return point, so the cleanup has to be done properly anyway. def

Re: return in loop for ?

2005-11-24 Thread Peter Hansen
Fredrik Lundh wrote: Steve Holden wrote: sepcifications did you mean: sceptifications ? (otoh, with 11,100 google hits, sepcifications should probably be considered as a fully acceptable alternate spelling ;-) Not if they're all in pages at site:holdenweb.com ! grin --

Re: Making immutable instances

2005-11-24 Thread Antoon Pardon
Op 2005-11-24, Mike schreef [EMAIL PROTECTED]: Ben Finney [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Howdy all, How can a (user-defined) class ensure that its instances are immutable, like an int or a tuple, without inheriting from those types? What caveats should be

Re: Making immutable instances

2005-11-24 Thread Scott David Daniels
Ben Finney wrote: Alex Martelli [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: How can a (user-defined) class ensure that its instances are immutable, like an int or a tuple, without inheriting from those types? You can make a good start by defining __setattr__, __delattr__ (and

Re: Writing big XML files where beginning depends on end.

2005-11-24 Thread Neil Benn
Magnus Lycka wrote: snip In some cases, building up a DOM tree in memory takes up several GB of RAM, which is a real showstopper. The actual file is maybe a magnitute smaller than the DOM tree. The app is using libxml2. It's actually written in C++. Some library that used much less memory

Re: return in loop for ?

2005-11-24 Thread Scott David Daniels
Fredrik Lundh wrote: Steve Holden wrote: sepcifications did you mean: sceptifications ? QOTW! I love it. I need to insert this in my vocabulary instantly! --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as Guido Intended

2005-11-24 Thread Antoon Pardon
Op 2005-11-24, Simon Brunning schreef [EMAIL PROTECTED]: On 24 Nov 2005 11:30:04 GMT, Antoon Pardon [EMAIL PROTECTED] wrote: But he's consistently a better judge of language design than I am, and in all likelihood better than you, too. If you like Python, it's 'cos you like the decisions

[Fwd: Python Midi Package: writing events non-chronologically]

2005-11-24 Thread tim
(...I sent this one a second time, waited for 60 minutes, it didn't appear, sorry if it's a double...) Someone using Python Midi Package from http://www.mxm.dk/products/public/ lately? I want to do the following : write some note events in a midi file then after doing that, put some

Re: wxPython Licence vs GPL

2005-11-24 Thread Jorge Godoy
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: I meant the SCO saga, don't know if you are referring the same thing. Probably. MS bought some shares from SCO to help financing the lawsuit. Anyway, I don't see much people worrying about it and in fact, I see more people laughing about SCO's

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Christoph Zwerschke
Duncan Booth schrieb: On IE this will go through elements in the order 0, 1, 2, 4, 3. Oops! I bet most people would not expect that, and it is probably not mentioned in most Javascript tutorials. I think this is a weakpoint of the ECMA definition, not MSIE. -- Christoph --

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Fuzzyman
Tom Anderson wrote: On Tue, 22 Nov 2005, Christoph Zwerschke wrote: One implementation detail that I think needs further consideration is in which way to expose the keys and to mix in list methods for ordered dictionaries. In Foord/Larosa's odict, the keys are exposed as a public

Re: Python Midi Package: writing events non-chronologically

2005-11-24 Thread Max M
tim wrote: Someone using Python Midi Package from http://www.mxm.dk/products/public/ lately? I want to do the following : write some note events in a midi file then after doing that, put some controllers at the beginning of the midifile (because I want to be able to make those dependant on

Your message to documentation awaits moderator approval

2005-11-24 Thread documentation-bounces
Your mail to 'documentation' with the subject pcgiqaqwbxsoyvyg Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of

Your message to documentation awaits moderator approval

2005-11-24 Thread documentation-bounces
Your mail to 'documentation' with the subject pcgiqaqwbxsoyvyg Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive notification of

ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-24 Thread Nico Grubert
Hi there, I am using the ftplib library to connect to a ftp server. After I got connected, I can see a list of file in the current directory using ftp.dir() or ftp.retrlines('LIST'). But using ftp.nlst() returns an empty list which seems somehow strange to me. Here is, what I did: from

Re: Making immutable instances

2005-11-24 Thread Ben Finney
Alex Martelli [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: Why is I want to make objects immutable seen as I don't trust my users? Are Python's existing immutable types also seen the same way? If not, why the distinction? A type implemented in C offers different

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread Magnus Lycka
Antoon Pardon wrote: What does this mean? It means that the hammer works better if you learn how to hold and swing it, instead of trying to modify it so that it's more comfortable to use it in a non-optimal way. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-24 Thread Bengt Richter
On Wed, 23 Nov 2005 23:00:29 +0100, Christoph Zwerschke [EMAIL PROTECTED] wrote: Fuzzyman wrote: So what do you want returned when you ask for d1[1] ? The member keyed by 1, or the item in position 1 ? In case of conflict, the ordered dictionary should behave like a dictionary, not like a

Re: wxPython Licence vs GPL

2005-11-24 Thread Paul Boddie
Ed Jensen wrote: [On closed source derivatives of Python] I'm aware of this concern. I don't think it's justified. Unless you'd like to point out all those closed, proprietary Python implementations that are destroying civilization as we know it. Well, there was some concern voiced at

Re: ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-24 Thread Fredrik Lundh
Nico Grubert wrote: I am using the ftplib library to connect to a ftp server. After I got connected, I can see a list of file in the current directory using ftp.dir() or ftp.retrlines('LIST'). But using ftp.nlst() returns an empty list which seems somehow strange to me. Here is, what I did:

Re: Writing big XML files where beginning depends on end.

2005-11-24 Thread Fredrik Lundh
Magnus Lycka wrote: We're using DOM to create XML files that describes fairly complex calculations. The XML is structured as a big tree, where elements in the beginning have values that depend on other values further down in the tree. Imagine something like below, but much bigger and much

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread Bengt Richter
On 24 Nov 2005 03:22:26 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Bengt Richter wrote: If windows has been running a long time (a few days or a week may be long ;-) it may get fragmented in some smallish memory arena reserved for special things (I forgot what versions, but I

Re: Making immutable instances

2005-11-24 Thread Roel Schroeven
Antoon Pardon wrote: Op 2005-11-24, Mike schreef [EMAIL PROTECTED]: and many a time. I've been annoyed (in Java and MS christelijke vorm er van. frameworks) Antoon, I don't think Mike wrote it like that :) I don't even know how I spotted that, since I didn't really read that part of the text. I

Re: Using Cron to run a python program

2005-11-24 Thread Frithiof Andreas Jensen
[EMAIL PROTECTED] skrev i en meddelelse news:[EMAIL PROTECTED] permissions just to be safe. What would cause the logging to work at a command prompt but fail in cron? Because the environment is different; man cron might tell *how* it is different (I cannot because it varies with platform,

Locking a file under Windows

2005-11-24 Thread Guy Lateur
Hi all, I'm working on an application that will be used by several users at the same time. The user should be able to both read and write to some data file stored on our file server. My question is: how can I prevent that one user writes to the file while another user is reading it? I've seen

  1   2   3   >