Re: partial sums problem

2010-09-29 Thread Chris Torek
In article kj wrote: >The following attempt to get a list of partial sums fails: > s = 0 [((s += t) and s) for t in range(1, 10)] > File "", line 1 >[((s += t) and s) for t in range(1, 10)] > ^ >SyntaxError: invalid syntax > >What's the best way to get a list of partial s

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Chris Rebert
On Tue, Sep 28, 2010 at 11:43 PM, rustom wrote: > On Sep 29, 5:32 am, Chris Rebert wrote: >> On Tue, Sep 28, 2010 at 2:55 AM, Malcolm McLean >> wrote: >> > On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) >> > wrote: >> >> On the other hand, with the dynamic typing mindset, you

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Rustom Mody
On Wed, Sep 29, 2010 at 12:44 PM, Chris Rebert wrote: > On Tue, Sep 28, 2010 at 11:43 PM, rustom wrote: > > A currently developed language with units is curl: see > > http://developers.curl.com/userdocs/docs/en/dguide/quantities-basic.html > > Frink's most recent version is only 17 days old. (Yo

Re: Upload files with wsgi

2010-09-29 Thread Richard Thomas
On Sep 28, 11:31 pm, Hidura wrote: > Hello, i have a project on Python3k, and i have a very big problem i > don' t find how take an upload file i am using the wsgiref lib, and or > theres any way to connect to the client in order to get the file by > myself? > > Thank you > Diego Hidalgo. > > -- >

File holes in Linux

2010-09-29 Thread Tom Potts
Hi, all. I'm not sure if this is a bug report, a feature request or what, so I'm posting it here first to see what people make of it. I was copying over a large number of files using shutil, and I noticed that the final files were taking up a lot more space than the originals; a bit more investig

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Torsten Zühlsdorff
Keith Thompson schrieb: >>> print c # floating point accuracy aside 299792458.0 m/s Actually, the speed of light is exactly 299792458.0 m/s by definition. Yes, but just in vacuum. Greetings, Torsten -- http://www.dddbl.de - ein Datenbank-Layer, der die Arbeit mit 8 verschiedenen Datenba

Paramiko and Threading

2010-09-29 Thread Jacob Abraham
Hi, Could someone help me understand how to using threading along with paramiko. For some reason only one of two of the threads returns the output correctly. Some of the threads returns an empty string as command output, but no errors are thrown. My attempt is pasted below. regards, Jacob

Certificate validation with HTTPSConnection

2010-09-29 Thread Velko Ivanov
Hello, I've always wandered why HTTPSConnection does not validate certificates? It is fairly simple to use the SSL socket's validation: > class HTTPSConnection(HTTPConnection): > """This class allows communication via SSL. > It is a copy of the http.client.HTTPSConnection with added certifi

Re: utf-8 and ctypes

2010-09-29 Thread Lawrence D'Oliveiro
In message , Brendan Miller wrote: > It seems that characters not in the ascii subset of UTF-8 are > discarded by c_char_p during the conversion ... Not a chance. > ... or at least they don't print out when I go to print the string. So it seems there’s a problem on the printing side. What happ

Re: Nautilus Python

2010-09-29 Thread Lawrence D'Oliveiro
In message , Eduardo Ribeiro wrote: > But it doesn't work. What messages do you get? -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Pascal J. Bourguignon
George Neuner writes: > On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson > wrote: > >>George Neuner writes: >>> On 28 Sep 2010 12:42:40 GMT, Albert van der Horst >>> wrote: I would say the dimensional checking is underrated. It must be complemented with a hard and fast rule about onl

if the else short form

2010-09-29 Thread Tracubik
Hi all, I'm studying PyGTK tutorial and i've found this strange form: button = gtk.Button(("False,", "True,")[fill==True]) the label of button is True if fill==True, is False otherwise. i have googled for this form but i haven't found nothing, so can any of you pass me any reference/link to thi

Re: Example or recomendation of a webserver

2010-09-29 Thread Diez B. Roggisch
Hidura writes: > I am working on a web project written on Py3k and using mod_wsgi on > the Apache that have to recibes the request client via a xml structure > and i am facing a lot of troubles with the upload files mainly because > i can' t see where they are, so i' ve decide to write my own web

Re: if the else short form

2010-09-29 Thread Joost Molenaar
Hi Nico, it's converting fill==True to an int, thereby choosing the string "False," or "True," by indexing into the tuple. Try this in an interpreter: >>> ['a','b'][False] 'a' >>> ['a','b'][True] 'b' >>> int(False) 0 >>> int(True) 1 Joost On 29 September 2010 12:42, Tracubik wrote: > > Hi all,

Re: if the else short form

2010-09-29 Thread Tom Potts
This is just a sneaky shorthand, which is fine if that's what you want, but it makes it harder to read. The reason it works is that 'fill==True' is a boolean expression, which evaluates to True or False, but if you force a True into being an integer, it will be 1, and a False will become 0. Try w

System idle time under Linux

2010-09-29 Thread Hugo Léveillé
I have found it for windows and mac, but no luck under linux. Any idea? Thanks -- Hugo Léveillé hu...@fastmail.net -- http://mail.python.org/mailman/listinfo/python-list

Re: if the else short form

2010-09-29 Thread Hrvoje Niksic
Tracubik writes: > Hi all, > I'm studying PyGTK tutorial and i've found this strange form: > > button = gtk.Button(("False,", "True,")[fill==True]) > > the label of button is True if fill==True, is False otherwise. The tutorial likely predates if/else expression syntax introduced in 2.5, which w

scheduler or infinite loop

2010-09-29 Thread harryos
hi I am trying to write a program to read data from a site url. The program must read the data from site every 5 minutes. def get_data_from_site(pageurlstr): h=urllib.urlopen(pageurlstr) data=h.read() process_data(data) At first, I thought of using the sched module ,but then it doesn'

Re: scheduler or infinite loop

2010-09-29 Thread Nitin Pawar
why not schedule cron */5 * * * * and check in your code that previous execution was successful or not On Wed, Sep 29, 2010 at 5:29 PM, harryos wrote: > hi > I am trying to write a program to read data from a site url. > The program must read the data from site every 5 minutes. > > def get_dat

Re: About __class__ of an int literal

2010-09-29 Thread Steven D'Aprano
On Wed, 29 Sep 2010 02:20:55 +0100, MRAB wrote: > On 29/09/2010 01:19, Terry Reedy wrote: >> A person using instances of a class should seldom use special names >> directly. They are, in a sense, implementation details, even if >> documented. The idiom "if __name__ == '__main__':" is an exception

Re: list problem...

2010-09-29 Thread Steven D'Aprano
On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: > On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: > >> On Tue, Sep 28, 2010 at 11:44 AM, Rog wrote: >>> Hi all, >>> Have been grappling with a list problem for hours... a = [2, 3, 4, >>> 5,.] >>> b = [4, 8, 2, 6,.] >>> Basicly I am

Re: [Python-list] if the else short form

2010-09-29 Thread Brendan Simon (eTRIX)
On 29/09/10 9:20 PM, python-list-requ...@python.org wrote: > Subject: > if the else short form > From: > Tracubik > Date: > 29 Sep 2010 10:42:37 GMT > > To: > python-list@python.org > > > Hi all, > I'm studying PyGTK tutorial and i've found this strange form: > > button = gtk.Button(("False,", "T

Re: About __class__ of an int literal

2010-09-29 Thread Hrvoje Niksic
Steven D'Aprano writes: > On Wed, 29 Sep 2010 02:20:55 +0100, MRAB wrote: > >> On 29/09/2010 01:19, Terry Reedy wrote: > >>> A person using instances of a class should seldom use special names >>> directly. They are, in a sense, implementation details, even if >>> documented. The idiom "if __name

Re: list problem...

2010-09-29 Thread bruno.desthuilli...@gmail.com
On 29 sep, 14:17, Steven D'Aprano wrote: > On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: > > On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: > > >> On Tue, Sep 28, 2010 at 11:44 AM, Rog wrote: > >>> Hi all, > >>> Have been grappling with a list problem for hours... a = [2, 3, 4, > >>> 5

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Paul Wallich
On 9/29/10 6:40 AM, Pascal J. Bourguignon wrote: George Neuner writes: On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson wrote: George Neuner writes: On 28 Sep 2010 12:42:40 GMT, Albert van der Horst wrote: I would say the dimensional checking is underrated. It must be complemented wit

Re: if the else short form

2010-09-29 Thread bruno.desthuilli...@gmail.com
On 29 sep, 13:38, Hrvoje Niksic wrote: > Tracubik writes: > > > button = gtk.Button(("False,", "True,")[fill==True]) (snip) > BTW adding "==True" to a boolean value is redundant and can even break > for logically true values that don't compare equal to True (such as the > number 10 or the strin

Re: if the else short form

2010-09-29 Thread Alex Willmer
On Sep 29, 12:38 pm, Hrvoje Niksic wrote: > Tracubik writes: > > Hi all, > > I'm studying PyGTK tutorial and i've found this strange form: > > > button = gtk.Button(("False,", "True,")[fill==True]) > > > the label of button is True if fill==True, is False otherwise. > > The tutorial likely predat

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
harryos wrote: hi I am trying to write a program to read data from a site url. The program must read the data from site every 5 minutes. def get_data_from_site(pageurlstr): h=urllib.urlopen(pageurlstr) data=h.read() process_data(data) At first, I thought of using the sched module ,bu

Re: sequence multiplied by -1

2010-09-29 Thread Lawrence D'Oliveiro
In message , Seebs wrote: > Helps, perhaps, that I got exposed to group theory early enough to be used > to redefining + and * to be any two operations which have interesting > properties ... But groups only have one such operation; it’s rings and fields (and number systems) that have two. -- h

Re: scheduler or infinite loop

2010-09-29 Thread harryos
thanks Frank > > Here is a technique that allows the loop to run in the background, in its > own thread, leaving the main program to do other processing - > > import threading > > class DataGetter(threading.Thread): > -- http://mail.python.org/mailman/listinfo/python-list

Re: Introducing Kids to Programming: 2 or 3?

2010-09-29 Thread Emeka
Marco, This is a great news coming out of Africa. I would very much like to see this your success story replicate across the continent. I would like to participate and to have your programs for my country, Nigeria. >From what you asked for, I would say that those kids should be part of the futur

PyCObject & malloc creating memory leak

2010-09-29 Thread Tom Conneely
I'm attempting to write a library for reading data via USB from a device and processing the data to display graphs. I have already implemented parts of this code as pure python, as a proof of concept but I have now moved on to implementing the functions in a C extension. My original plan was to ha

Supplementing the std lib (Was: partial sums problem)

2010-09-29 Thread kj
In Terry Reedy writes: >Do not try to do a reduction with a comprehension. Just write clear, >straightforward code that obviously works. >s=[1,2,3,4,5,6] >def cusum(s): > t = 0 > for i in s: > t += i > yield t >print(list(cusum(s))) > >>> >[1, 3, 6, 10, 15, 21] Actually, th

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that ? Thanks alot On Thu, 30 Sep 2010 02:01 +1300, "Lawrence D'Oliveiro" wrote: > /proc/stat or /proc/uptime, depending. See the proc(5) man page. > -- > http://mail.python.org/mailma

Re: Reoedering indexes in list of list

2010-09-29 Thread Andreas Waldenburger
On Tue, 28 Sep 2010 11:55:18 -0700 (PDT) Toto wrote: > Hello, > > I have a list of list > assume myList[x][y] is integer > I would like to create an alias to that list which I could call this > way: > alias[y][x] returns myList[x][y] > > how can I do that ? (python 2.6) > > (I have a feeling I

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Keith Thompson
Erik Max Francis writes: > Keith Thompson wrote: >> Erik Max Francis writes: >> [...] >>> >>> print c # floating point accuracy aside >>> 299792458.0 m/s >> >> Actually, the speed of light is exactly 299792458.0 m/s by >> definition. (The meter and the second are defined in terms of the >> sam

Re: toy list processing problem: collect similar terms

2010-09-29 Thread w_a_x_man
On Sep 26, 9:24 am, p...@informatimago.com (Pascal J. Bourguignon) wrote: > Xah Lee writes: > > here's a interesting toy list processing problem. > > > I have a list of lists, where each sublist is labelled by > > a number. I need to collect together the contents of all sublists > > sharing > > th

embedding python in macOS 10.6

2010-09-29 Thread tinau...@libero.it
hi there, i'm trying to embed python in a c++ code.i'm starting with the example in the tutorial.i've problem with setting up the enveiroment. I've installed python with the distributed version (i.e., i did not, as a start, build it myself); i added the library where both python.h and pyconfig

Python becoming orphaned over ssh

2010-09-29 Thread David
Hi there, I have a strange situation. If I do this: 1. Make a script /tmp/test.py on a remote server, with this contents: #!/usr/bin/python from subprocess import check_call check_call(['ping', 'www.google.com']) 2. Call the script like this over SSH: ssh r...@testbox /tmp/test.py 3. Interrup

R: embedding python in macOS 10.6

2010-09-29 Thread tinau...@libero.it
sorry, my error; in order to achieve what written before, i had to link to the libpython2.6.a that i find downloading the surce code. instead, if I link to the one of the distributed version, i get the following error: missing required architecture x86_64 in file. i tried to build with the -m32 o

Re: Re: Re: Upload files with wsgi

2010-09-29 Thread hidura
That is what i get: FieldStorage(None, None, []) On Sep 29, 2010 8:39am, hid...@gmail.com wrote: Python3k give me an error doing that. On Sep 29, 2010 3:55am, Richard Thomas chards...@gmail.com> wrote: > On Sep 28, 11:31 pm, Hidura hid...@gmail.com> wrote: > > > Hello, i have a project on Pyt

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that? Good grief. They're text files. You open them, you read them, you parse the contents for the stuff you want. -- Grant Edwards

Re: System idle time under Linux

2010-09-29 Thread Thomas Jollans
On Wednesday 29 September 2010, it occurred to Hugo Léveillé to exclaim: > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that > ? Parse the files. They may be very special files, but they are just files. > > Thanks alot > > > O

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Sorry, I am not a linux guy. Did not know it was a text file On Wed, 29 Sep 2010 14:48 +, "Grant Edwards" wrote: > On 2010-09-29, Hugo L?veill? wrote: > > > > Thanks, will take a closer look on that > > > > But to get me started, how would you get, via python, the info from that? > > Good

Re: if the else short form

2010-09-29 Thread Philip Semanchuk
On Sep 29, 2010, at 7:19 AM, Tom Potts wrote: > This is just a sneaky shorthand, which is fine if that's what you want, but > it makes it harder to read. The reason it works is that 'fill==True' is a > boolean expression, which evaluates to True or False, but if you force a > True into being an

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > Sorry, I am not a linux guy. Did not know it was a text file And the "file" command (the usual way to figure that out) doesn't appear to be helpful: $ file /etc/passwd /etc/passwd: ASCII text [That's helpful] $ file /proc/stat /proc/stat: empty

how to test get_special_folder_path()?

2010-09-29 Thread Philip Semanchuk
Hi all, The documentation for get_special_folder_path() and friends says that they're "available as additional built-in functions in the installation script". http://docs.python.org/distutils/builtdist.html#the-postinstallation-script Does anyone know of a way to play around with these functions

Re: if the else short form

2010-09-29 Thread Emile van Sebille
On 9/29/2010 5:53 AM Philip Semanchuk said... Does Python make any guarantee that int(True) == 1 and int(False) == 0 will always hold, or are their values an implementation detail? I had exactly this same question occur to me yesterday, and yes, I believe it does. From http://docs.python.

Re: if the else short form

2010-09-29 Thread Andreas Waldenburger
On Wed, 29 Sep 2010 08:53:17 -0400 Philip Semanchuk wrote: > Does Python make any guarantee that int(True) == 1 and int(False) == > 0 will always hold, or are their values an implementation detail? > Bool

Re: bzr 2.2.1 released !

2010-09-29 Thread Sridhar Ratnakumar
Hi, It seems that you forgot to update PyPI - which lists 2.1.0rc1 as the latest version. -srid On 2010-09-28, at 7:20 AM, Vincent Ladeuil wrote: > The Bazaar team is happy to announce availability of a new > release of the bzr adaptive version control system. > Bazaar is part of the GNU syste

Re: Python becoming orphaned over ssh

2010-09-29 Thread John Nagle
On 9/29/2010 7:24 AM, David wrote: Hi there, I have a strange situation. If I do this: 1. Make a script /tmp/test.py on a remote server, with this contents: #!/usr/bin/python from subprocess import check_call Python's signal handling for multithread and multiprocess programs leaves someth

Determine sockets in use by python

2010-09-29 Thread Jim Mellander
Hi: I'm a newbie to python, although not to programming. Briefly, I am using a binding to an external library used for communication in a client-server context, with the server in python. Typically, I would set this up with event callbacks, and then enter a select loop, which, most the time idle

Re: Supplementing the std lib (Was: partial sums problem)

2010-09-29 Thread Ethan Furman
kj wrote: I'm interested in reading people's take on the question and their way of dealing with those functions they consider worthy of the standard library.) Well, I have no functions than I'm lobbying to get into the stdlib, but for all those handy-dandy utility functions, decorators, and cl

Re: if the else short form

2010-09-29 Thread Seebs
On 2010-09-29, Tracubik wrote: > Hi all, > I'm studying PyGTK tutorial and i've found this strange form: > > button = gtk.Button(("False,", "True,")[fill==True]) > > the label of button is True if fill==True, is False otherwise. > > i have googled for this form but i haven't found nothing, so can

Re: sequence multiplied by -1

2010-09-29 Thread Seebs
On 2010-09-29, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: >> Helps, perhaps, that I got exposed to group theory early enough to be used >> to redefining + and * to be any two operations which have interesting >> properties ... > But groups only have one such operation; it???s rings an

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? wrote: > I have found it for windows and mac, but no luck under linux. Any idea? I don't think it's semantically well-defined. What makes a system "idle"? Is the machine in my basement idle? I don't think anyone's touched the keyboard in a week, but it's spent a bi

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Thomas A. Russ
George Neuner writes: > On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson > wrote: > >He didn't say it was. Internal calculations are done in SI units (in > >this case, m^3/sec); on output, the internal units can be converted to > >whatever is convenient. > > That's true. But it is a situati

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-29 Thread namekuseijin
On 28 set, 19:38, Xah Lee wrote: > • “list comprehension” is a very bad jargon; thus harmful to > functional programing or programing in general. Being a bad jargon, it > encourage mis-communication, mis-understanding. I disagree: it is a quite intuitive term to describe what the expression does

Re: Determine sockets in use by python

2010-09-29 Thread Gary Herron
On 09/29/2010 09:50 AM, Jim Mellander wrote: Hi: I'm a newbie to python, although not to programming. Briefly, I am using a binding to an external library used for communication in a client-server context, with the server in python. Typically, I would set this up with event callbacks, and then

Re: "Strong typing vs. strong testing"

2010-09-29 Thread MRAB
On 29/09/2010 18:54, Thomas A. Russ wrote: George Neuner writes: On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson wrote: He didn't say it was. Internal calculations are done in SI units (in this case, m^3/sec); on output, the internal units can be converted to whatever is convenient. Tha

Re: "Strong typing vs. strong testing"

2010-09-29 Thread George Neuner
On Wed, 29 Sep 2010 12:40:58 +0200, p...@informatimago.com (Pascal J. Bourguignon) wrote: >George Neuner writes: > >> On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson >> wrote: >> >>>George Neuner writes: On 28 Sep 2010 12:42:40 GMT, Albert van der Horst wrote: >I would say the

Re: utf-8 and ctypes

2010-09-29 Thread Brendan Miller
2010/9/29 Lawrence D'Oliveiro : > In message , Brendan > Miller wrote: > >> It seems that characters not in the ascii subset of UTF-8 are >> discarded by c_char_p during the conversion ... > > Not a chance. > >> ... or at least they don't print out when I go to print the string. > > So it seems the

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Good point One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for On Wed, 29 Sep 2010 17:27 +, "Seebs" wrote: > On 2010-09-29, Hugo L?veill? wrote: > > I have found it for windows and mac, but n

Re: About __class__ of an int literal

2010-09-29 Thread Terry Reedy
On 9/29/2010 8:34 AM, Hrvoje Niksic wrote: Steven D'Aprano writes: On Wed, 29 Sep 2010 02:20:55 +0100, MRAB wrote: On 29/09/2010 01:19, Terry Reedy wrote: A person using instances of a class should seldom use special names directly. They are, in a sense, implementation details, even if do

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? wrote: > One I am looking for, is time since last user mouse or keyboard action. > So I guess I am looking for the exact same thing a screensaver is > looking for You can probably get it from X somehow, but... Basically, be aware that it is entirely possible for a Lin

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? wrote: > One I am looking for, is time since last user mouse or keyboard action. > So I guess I am looking for the exact same thing a screensaver is > looking for Oh. That's not what "idle" generally means in a Unix/Linux context, so you can disregard previous answe

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Squeamizh
On Sep 27, 10:46 am, namekuseijin wrote: > On 27 set, 05:46, TheFlyingDutchman wrote: > > > > > > > On Sep 27, 12:58 am, p...@informatimago.com (Pascal J. Bourguignon) > > wrote: > > > RG writes: > > > > In article > > > > <7df0eb06-9be1-4c9c-8057-e9fdb7f0b...@q16g2000prf.googlegroups.com>, > >

Re: Determine sockets in use by python

2010-09-29 Thread Jim Mellander
Hi Gary: Certainly not windows I'm developing on OS/X but for production probably Linux and FreeBSD (I'm hoping for something a bit more portable than running 'lsof' and parsing the output, but appreciate any/all advice) On Wed, Sep 29, 2010 at 11:05 AM, Gary Herron wrote: > On 09/29/2010

Re: File holes in Linux

2010-09-29 Thread Ned Deily
In article , Tom Potts wrote: > Hi, all. I'm not sure if this is a bug report, a feature request or what, > so I'm posting it here first to see what people make of it. I was copying > over a large number of files using shutil, and I noticed that the final > files were taking up a lot more spac

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread Ned Deily
In article , Velko Ivanov wrote: > I've always wandered why HTTPSConnection does not validate > certificates? > > It is fairly simple to use the SSL socket's validation: [...] Perhaps you can write up your example as a documentation patch to the http.client documentation page and submit it t

Re: File holes in Linux

2010-09-29 Thread Christian Heimes
Am 29.09.2010 11:05, schrieb Tom Potts: > A quick `ls -sl filehole.test' will show that the created file actually > takes up about 980k, rather than the 0 bytes expected. > > If anyone can let me know if this is indeed a bug or feature request, how to > get around it, or where to take it next, I'd

Re: File holes in Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Ned Deily wrote: >, > Tom Potts wrote: >> Hi, all. I'm not sure if this is a bug report, a feature request or what, >> so I'm posting it here first to see what people make of it. I was copying >> over a large number of files using shutil, and I noticed that the final >> files we

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread John Nagle
On 9/29/2010 1:18 PM, Ned Deily wrote: In article, Velko Ivanov wrote: I've always wandered why HTTPSConnection does not validate certificates? It is fairly simple to use the SSL socket's validation: [...] Perhaps you can write up your example as a documentation patch to the http.client d

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-29 Thread Xah Lee
On Sep 29, 11:02 am, namekuseijin wrote: > On 28 set, 19:38, Xah Lee wrote: > > > • “list comprehension” is a very bad jargon; thus harmful to > > functional programing or programing in general. Being a bad jargon, it > > encourage mis-communication, mis-understanding. > > I disagree:  it is a qu

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-29 Thread Ian Kelly
On Wed, Sep 29, 2010 at 2:46 PM, Xah Lee wrote: > what's your basis in saying that “list comprehension” is intuitive? > > any statics, survery, research, references you have to cite? > > to put this in context, are you saying that lambda, is also intuitive? > “let” is intuitive? “for” is intuitiv

Re: list problem...

2010-09-29 Thread Rog
On Wed, 29 Sep 2010 05:52:32 -0700, bruno.desthuilli...@gmail.com wrote: > On 29 sep, 14:17, Steven D'Aprano > wrote: >> On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: >> > On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: >> >> >> On Tue, Sep 28, 2010 at 11:44 AM, Rog wrote: >> >>> Hi al

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article <996bd4e6-37ff-4a55-8db5-6e7574fbd...@k22g2000prb.googlegroups.com>, Squeamizh wrote: > On Sep 27, 10:46 am, namekuseijin wrote: > > On 27 set, 05:46, TheFlyingDutchman wrote: > > > > > > > > > > > > > On Sep 27, 12:58 am, p...@informatimago.com (Pascal J. Bourguignon) > > > wrote:

Re: Example or recomendation of a webserver

2010-09-29 Thread Hidura
I use Python3.1, TurboGears, webOb, CherryPy and the others don' t work on Python 3, please somebody recomend me a web framework for Python3.1 I AM DESPERATE On Wed, Sep 29, 2010 at 6:08 PM, Hidura wrote: > I use Python3.1, TurboGears, webOb, CherryPy and the others don' t work on > Python 3, pl

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Squeamizh
On Sep 29, 3:02 pm, RG wrote: > In article > <996bd4e6-37ff-4a55-8db5-6e7574fbd...@k22g2000prb.googlegroups.com>, > > > > > >  Squeamizh wrote: > > On Sep 27, 10:46 am, namekuseijin wrote: > > > On 27 set, 05:46, TheFlyingDutchman wrote: > > > > > On Sep 27, 12:58 am, p...@informatimago.com (Pa

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, Squeamizh wrote: > On Sep 29, 3:02 pm, RG wrote: > > In article > > <996bd4e6-37ff-4a55-8db5-6e7574fbd...@k22g2000prb.googlegroups.com>, > > > > > > > > > > > >  Squeamizh wrote: > > > On Sep 27, 10:46 am, namekus

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread Ned Deily
In article <4ca3a46b.4080...@animats.com>, John Nagle wrote: > We've been through this. Too many times. > > http://bugs.python.org/issue1114345 > (2005: Broken in Python 2.2, eventually fixed) > > http://www.justinsamuel.com/2008/12/25/the-importance-of-validating-ssl-certif > icates/ > (

Re: utf-8 and ctypes

2010-09-29 Thread MRAB
On 29/09/2010 19:33, Brendan Miller wrote: > 2010/9/29 Lawrence D'Oliveiro: >> In message, Brendan >> Miller wrote: >> >>> It seems that characters not in the ascii subset of UTF-8 are >>> discarded by c_char_p during the conversion ... >> >> Not a chance. >> >>> ... or at least they don't print ou

Re: PyCObject & malloc creating memory leak

2010-09-29 Thread Antoine Pitrou
On Wed, 29 Sep 2010 06:50:05 -0700 (PDT) Tom Conneely wrote: > > My original plan was to have the data processing and data acquisition > functions running in separate processes, with a multiprocessing.Queue > for passing the raw data packets. The raw data is read in as a char*, > with a non const

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread Antoine Pitrou
On Wed, 29 Sep 2010 13:41:15 -0700 John Nagle wrote: > > The really stupid thing about the current SSL module is that it > accepts a file of root certificates as a parameter, but ignores it. That's not true. You have to pass CERT_OPTIONAL or CERT_REQUIRED as a parameter (CERT_NONE is though). R

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Keith Thompson
RG writes: > In article > <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, > Squeamizh wrote: >> On Sep 29, 3:02 pm, RG wrote: [...] >> > This is a red herring.  You don't have to invoke run-time input to >> > demonstrate bugs in a statically typed language that are not cau

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Pascal J. Bourguignon
Squeamizh writes: > In short, static typing doesn't solve all conceivable problems. > > We are all aware that there is no perfect software development process > or tool set. I'm interested in minimizing the number of problems I > run into during development, and the number of bugs that are in th

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article , Keith Thompson wrote: > RG writes: > > In article > > <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, > > Squeamizh wrote: > >> On Sep 29, 3:02 pm, RG wrote: > [...] > >> > This is a red herring.  You don't have to invoke run-time input to > >> > demonstrat

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Thomas A. Russ
RG writes: > > More power to you. What are you doing here on cll then? This thread is massively cross-posted. -- Thomas A. Russ, USC/Information Sciences Institute -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Keith Thompson
RG writes: > In article , > Keith Thompson wrote: > >> RG writes: >> > In article >> > <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, >> > Squeamizh wrote: >> >> On Sep 29, 3:02 pm, RG wrote: >> [...] >> >> > This is a red herring.  You don't have to invoke run-time in

Re: list problem...

2010-09-29 Thread Shashwat Anand
On Thu, Sep 30, 2010 at 3:20 AM, Rog wrote: > On Wed, 29 Sep 2010 05:52:32 -0700, bruno.desthuilli...@gmail.com wrote: > > > On 29 sep, 14:17, Steven D'Aprano > > > wrote: > >> On Tue, 28 Sep 2010 20:11:51 +0100, Rog wrote: > >> > On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: > >> > >

Re: About __class__ of an int literal

2010-09-29 Thread Steven D'Aprano
On Wed, 29 Sep 2010 14:46:18 -0400, Terry Reedy wrote: >> In that sense the user >> should be calling iter(foo) instead of foo.__iter__(), next(foo) >> instead of foo.__next__(), and foo+bar instead of foo.__add__(bar). > > Yes. Guido added iter() and next() to the list of built-in functions, > e

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Squeamizh
On Sep 29, 3:14 pm, RG wrote: > In article > <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, > > > > > >  Squeamizh wrote: > > On Sep 29, 3:02 pm, RG wrote: > > > In article > > > <996bd4e6-37ff-4a55-8db5-6e7574fbd...@k22g2000prb.googlegroups.com>, > > > >  Squeamizh wrote:

ANNOUNCING Tahoe, the Least-Authority File System, v1.8.0

2010-09-29 Thread Zooko O'Whielacronx
Hello, people of python-list. This storage project uses Python for almost everything, except we use C/C++ for the CPU-intensive computations (cryptography and erasure coding) and we use JavaScript for some user interface bits. We're even looking at the possibility of replacing the C/C++ crypto code

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article , Keith Thompson wrote: > RG writes: > > In article , > > Keith Thompson wrote: > > > >> RG writes: > >> > In article > >> > <07f75df3-778d-4e3d-8aa0-fbd4bd108...@k22g2000prb.googlegroups.com>, > >> > Squeamizh wrote: > >> >> On Sep 29, 3:02 pm, RG wrote: > >> [...] > >> >> >

Re: Supplementing the std lib (Was: partial sums problem)

2010-09-29 Thread Paul Rubin
kj writes: > But in the immediate term, cusum is not part of the standard library. > > Where would you put it if you wanted to reuse it? Do you create > a module just for it? Or do you create a general stdlib2 module > with all those workhorse functions that have not made it to the > standard li

Re: About __class__ of an int literal

2010-09-29 Thread Steven D'Aprano
On Wed, 29 Sep 2010 14:34:33 +0200, Hrvoje Niksic wrote: > Steven D'Aprano writes: >> (This may change in the future. Given type(), and isinstance(), I'm not >> sure what value __class__ adds.) > > None whatsoever. __class__ used to be necessary to tell the appart > instances of different old-s

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Seebs
On 2010-09-30, RG wrote: > That the problem is "elsewhere in the program" ought to be small > comfort. It is, perhaps, but it's also an important technical point: You CAN write correct code for such a thing. > int maximum(int a, int b) { return a > b ? a : b; } > int main() { > long x = 858

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Keith Thompson
RG writes: [...] > That the problem is "elsewhere in the program" ought to be small > comfort. I don't claim that it's comforting, merely that it's true. > But very well, try this instead: > > [...@mighty:~]$ cat foo.c > #include > > int maximum(int a, int b) { return a > b ? a : b;

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Ian Collins
On 09/30/10 02:17 PM, Seebs wrote: On 2010-09-30, RG wrote: That the problem is "elsewhere in the program" ought to be small comfort. It is, perhaps, but it's also an important technical point: You CAN write correct code for such a thing. int maximum(int a, int b) { return a> b ? a : b; }

Re: Supplementing the std lib (Was: partial sums problem)

2010-09-29 Thread Ian Kelly
On Wed, Sep 29, 2010 at 7:06 PM, Paul Rubin wrote: > As for the stdlib, the natural places for such a function would be > either itertools or functools, and the function should probably be called > "scan", inspired by this: > > http://en.wikibooks.org/wiki/Haskell/List_processing#Scans > > Pytho

  1   2   >