Re: status of Programming by Contract (PEP 316)?

2007-09-01 Thread Ricardo Aráoz
Alex Martelli wrote: Ricardo Aráoz [EMAIL PROTECTED] wrote: ... We should remember that the level of security of a 'System' is the same as the level of security of it's weakest component, Not true (not even for security, much less for reliability which is what's being discussed here

Re: status of Programming by Contract (PEP 316)?

2007-08-31 Thread Ricardo Aráoz
Russ wrote: I've always wondered... Are the compilers (or interpreters), which take these programs to machine code, also formally proven correct? No, they are not formally proven correct (too complicated for that), but I believe they are certified to a higher level than your typical

Re: status of Programming by Contract (PEP 316)?

2007-08-31 Thread Ricardo Aráoz
Neil Cerutti wrote: On 2007-08-31, Ricardo Aráoz [EMAIL PROTECTED] wrote: Russ wrote: Yes, thanks for reminding me about that. With SPARK Ada, it is possible for some real (non-trivial) applications to formally (i.e., mathematically) *prove* correctness by static analysis. I doubt

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Ricardo Aráoz
Russ wrote: Paul Rubin wrote: Bruno Desthuilliers [EMAIL PROTECTED] writes: FWIW, the Eiffel and SPARK Ada folks also brilliantly explained why one can not hope to write reliable programs without strict static declarative type-checking. I don't know about Eiffel but at least an important

Re: list index()

2007-08-30 Thread Ricardo Aráoz
Alex Martelli wrote: [EMAIL PROTECTED] wrote: ... In my case of have done os.listdir() on two directories. I want to see what files are in directory A that are not in directory B. So why would you care about WHERE, in the listdir of B, are to be found the files that are in A but not B?!

Re: encoding problems

2007-08-29 Thread Ricardo Aráoz
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], tool69 wrote: p2.content = Ce poste possède des accents : é à ê è My guess is this is being encoded as a Latin-1 string, but when you try to output it it goes through the ASCII encoder, which doesn't understand the accents. Try

Re: Haskell like (c:cs) syntax

2007-08-29 Thread Ricardo Aráoz
Marco Mariani wrote: Ricardo Aráoz ha scritto: L = ['one', 'two', 'three', 'four', 'five'] print L[0]# This would be 'head' print L[1:] # This would be 'tail' Caution : L[0] and L[1:] are COPIES of the head and tail of the list. This might surprise people who see L[1

Re: copying files

2007-08-29 Thread Ricardo Aráoz
Brian McCann wrote: Hi, with the code below I set a variable TEST_HOME to a path and the variable m to a path in my current dir. I have a symbolic link setting mlib when I run the script I get no errors and the lib dir with its 20 files does not get copied to /v01/test_home any help

Re: copying files

2007-08-29 Thread Ricardo Aráoz
Brian McCann wrote: Hi, with the code below I set a variable TEST_HOME to a path and the variable m to a path in my current dir. I have a symbolic link setting mlib when I run the script I get no errors and the lib dir with its 20 files does not get copied to /v01/test_home any help

Re: copying files

2007-08-29 Thread Ricardo Aráoz
-r ./lib /v01/test_home' - This is what you want. cp -r m TEST_HOME 'cp -r m TEST_HOME'- This is NOT what you want. From: Ricardo Aráoz [mailto:[EMAIL PROTECTED] Sent: Wed 8/29/2007 2:51 PM To: Brian McCann Cc: python-list@python.org

Re: Haskell like (c:cs) syntax

2007-08-28 Thread Ricardo Aráoz
Stefan Niemann wrote: Hi, sorry that I'm relatively new to Python. But the syntax and semantics of Python already fascinate me, because I'm familiar with functional languages like Haskell. Is there a pattern matching construct in Python like (head : tail), meaning 'head' matches the

Re: How can I use python for file processing

2007-08-26 Thread Ricardo Aráoz
Marc 'BlackJack' Rintsch wrote: On Sun, 26 Aug 2007 06:05:11 +, [EMAIL PROTECTED] wrote: I am trying to use python for file processing. Suppose I have a file like this: I want to build a Hashmap between the line begin_QOS_statistics and end_QOS_statistics and for each line I want to

Re: introspection and functions

2007-08-23 Thread Ricardo Aráoz
Ayaz Ahmed Khan wrote: James Stroud typed: py def doit(a, b, c, x=14): ... pass ... py doit.func_code.co_argcount 4 py doit.func_code.co_varnames ('a', 'b', 'c', 'x') py doit.func_defaults (14,) Neat. How do you know the 14 corresponds to x ? --

Re: IDE for Python

2007-08-23 Thread Ricardo Aráoz
I V wrote: On Tue, 21 Aug 2007 21:23:25 -0300, Ricardo Aráoz wrote: Do you know if for in-house development a GPL license applies? (Qt4 and/or Eric4). (I'm not sure if I've understood your question right) If you distribute an app that _uses_ PyQT, you have to comply with the GPL

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: On Aug 21, 12:00 pm, Joel Andres Granados [EMAIL PROTECTED] wrote: Hello list: I have tried various times to use an IDE for python put have always been disapointed. I have also tried a lot of them (IDEs) in the last year. I was finally happy with Eclipse/Pydev but i

Re: IDE for Python

2007-08-21 Thread Ricardo Aráoz
king kikapu wrote: On Aug 21, 12:00 pm, Joel Andres Granados [EMAIL PROTECTED] wrote: Hello list: I have tried various times to use an IDE for python put have always been disapointed. I have also tried a lot of them (IDEs) in the last year. I was finally happy with Eclipse/Pydev but i

Hiding / encrypting source code

2007-08-17 Thread Ricardo Aráoz
Hi, I'm new to this python stuff so maybe I'm stating the obvious, or worse, maybe I'm completely off track. Not long ago someone was asking about a way to hide source code. I stumbled upon zipimport standard module. It seems it lets you get your imports from zip files. The docs say it is

Re: python 2.5 bug

2007-08-13 Thread Ricardo Aráoz
Dustan wrote: On Aug 11, 12:32 am, Thorsten Kampe [EMAIL PROTECTED] wrote: 4. don't do something you don't fully understand (in this case installing Python 2.5 and uninstalling Python 2.4) If we were all limited by that rule, none of us would never have used a computer in the first

Re: Finding gurus (was Re: Something in the function tutorial confused me.)

2007-08-13 Thread Ricardo Aráoz
Aahz wrote: In article [EMAIL PROTECTED], Alex Martelli [EMAIL PROTECTED] wrote: Because of this, a Google search for name surname python may sometimes help; when you get 116,000 hits, as for Steve Holden python, that may be a reasonable indication that the poster is one of the world's

Re: Misleading wikipedia article on Python 3?

2007-08-09 Thread Ricardo Aráoz
Evan Klitzke wrote: On 8/8/07, greg [EMAIL PROTECTED] wrote: Istvan Albert wrote: A solution would be writing the code with a logging function to begin with, alas many times that is out of one's hand. If the code has been written with calls to a builtin print function, the situation isn't

Re: Something in the function tutorial confused me.

2007-08-07 Thread Ricardo Aráoz
Lee Fleming wrote: Thanks for all the help, everyone. I guess I was confused with default arguments that were mutable and immutable. I will continue to look over these posts until I understand what is happening. I cannot believe the number of helpful responses I got! Apparently he didn't

Re: Formatting Results so that They Can be Nicely Imported into a Spreadsheet.

2007-08-05 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: In a message dated 8/4/2007 11:50:05 PM Central Daylight Time, [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: On Aug 4, 6:35?pm, SMERSH009 [EMAIL PROTECTED] wrote: Hi All. Let's say I have some badly formatted text called doc:

Re: What is the functional way of doing this?

2007-07-31 Thread Ricardo Aráoz
Considering I am a beginner I did a little test. Funny results too. The function I proposed (lists1.py) took 11.4529998302 seconds, while the other one (lists2.py) took 16.141324 seconds, thats about 40% more. They were run in IDLE from their own windows (F5). Of course my little test may me

Re: What is the functional way of doing this?

2007-07-31 Thread Ricardo Aráoz
Kept testing (just in case). There was this other version of lists2.py (see below). So I created lists3.py and lists4.py. The resulting times are lists1.py : 11.4529998302 lists2.py : 16.141324 lists3.py : 3.1713134 lists4.py : 20.983676 lists3.py is by

Re: Encryption recommendation

2007-07-31 Thread Ricardo Aráoz
Azazello wrote: On Jul 31, 10:19 am, JS [EMAIL PROTECTED] wrote: Can someone help me find the proper way to do AES encryption/decryption using Python? Thanks! I did a quick look around the internet and found this seemingly good link AES in general. Might be a good start.

Re: What is the functional way of doing this?

2007-07-31 Thread Ricardo Aráoz
Steven D'Aprano wrote: On Tue, 31 Jul 2007 09:01:42 -0300, Ricardo Aráoz wrote: Considering I am a beginner I did a little test. Funny results too. The function I proposed (lists1.py) took 11.4529998302 seconds, while the other one (lists2.py) took 16.141324 seconds, thats about 40% more

Re: What is the functional way of doing this?

2007-07-30 Thread Ricardo Aráoz
On Jul 30, 4:39 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] [EMAIL PROTECTED] writes: Recursion is common in functional programming: def f(n, l=None): if l == None: l = [] if n 0: return f(n/26, l + [n%26]) else: return l print

<    1   2