Re: bzr 2.2.1 released !

2010-09-29 Thread Vincent Ladeuil
> Sridhar Ratnakumar writes: > Hi, > It seems that you forgot to update PyPI - which lists 2.1.0rc1 as the latest version. > -srid This should be fixed now. Let us know if you encounter problems. Vincent -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Nick
Ian Collins writes: > On 09/30/10 05:57 PM, RG wrote: >> >> I'm not saying one should not use compile-time tools, only that one >> should not rely on them. "Compiling without errors" is not -- and >> cannot ever be -- be a synonym for "bug-free." > > We is why wee all have run time tools called

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article , Seebs wrote: > On 2010-09-30, RG wrote: > > Of course. Computers always do only exactly what you ask of them. On > > this view there is, by definition, no such thing as a bug, only > > specifications that don't correspond to one's intentions. > > f00f. > > That said... I th

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article , Keith Thompson wrote: > > I'm not saying one should not use compile-time tools, only that one > > should not rely on them. "Compiling without errors" is not -- and > > cannot ever be -- be a synonym for "bug-free." > > Agreed. (Though C does make it notoriously easy to sneak bu

Re: "Strong typing vs. strong testing"

2010-09-29 Thread TheFlyingDutchman
> > That argument can be made for dynamic language as well. If you write in > dynamic language (e.g. python): > > def maximum(a, b): >     return a if a > b else b > > The dynamic language's version of maximum() function is 100% correct -- > if you passed an uncomparable object, instead of a numbe

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Keith Thompson
RG writes: > In article , > Keith Thompson wrote: [...] >> Even here, maximum() did exactly what was asked of it. > > Of course. Computers always do only exactly what you ask of them. On > this view there is, by definition, no such thing as a bug, only > specifications that don't correspond

Re: utf-8 and ctypes

2010-09-29 Thread Mark Tolonen
"Brendan Miller" wrote in message news:aanlkti=2f3l++398st-16mpes8wzfblbu+qa8ztpa...@mail.gmail.com... 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 ch

Re: "Strong typing vs. strong testing"

2010-09-29 Thread TheFlyingDutchman
> > More specifically, the claim made above: > > > in C I can have a function maximum(int a, int b) that will always > > work. Never blow up, and never give an invalid answer. > > is false.  And it is not necessary to invoke the vagaries of run-time > input to demonstrate that it is false. > I don

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Lie Ryan
On 09/30/10 11:17, 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 >

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

2010-09-29 Thread Paul Rubin
Dennis Lee Bieber writes: >> Python's version would be like "scanl" with an optional arg to make it >> like "scanl1". > Vs APL's "expand" operator? I'm not familiar with that but maybe it's similar. -- http://mail.python.org/mailman/listinfo/python-list

Re: scheduler or infinite loop

2010-09-29 Thread John Nagle
On 9/29/2010 4:59 AM, 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) A key point here is

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Ian Collins
On 09/30/10 05:57 PM, RG wrote: I'm not saying one should not use compile-time tools, only that one should not rely on them. "Compiling without errors" is not -- and cannot ever be -- be a synonym for "bug-free." We is why wee all have run time tools called unit tests, don't we? -- Ian Colli

Re: "Strong typing vs. strong testing"

2010-09-29 Thread Seebs
On 2010-09-30, RG wrote: > Of course. Computers always do only exactly what you ask of them. On > this view there is, by definition, no such thing as a bug, only > specifications that don't correspond to one's intentions. f00f. That said... I think you're missing Keith's point. > Unfortun

Re: scheduler or infinite loop

2010-09-29 Thread Frank Millman
harryos wrote 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): thanks Frank A pleasure. I left out a line that will usually be desirable. At the e

Re: "Strong typing vs. strong testing"

2010-09-29 Thread RG
In article , Keith Thompson wrote: > 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 > > #inc

Re: Clarification of notation

2010-09-29 Thread Terry Reedy
On 9/29/2010 10:32 PM, Bruce Whealton wrote: Would you, and could you combine a dictionary with a list in this fashion? A python list is a mutable sequence of Python objects. Extremely mixed example. >>> mixed = [1, 1.0, '1', [1], (1,), {1:1}, set((1,)), list, list.append] >>> mixed.append(m

Re: Clarification of notation

2010-09-29 Thread Chris Rebert
On Wed, Sep 29, 2010 at 7:32 PM, Bruce Whealton wrote: > Hello all, >         I recently started learning python.  I am a bit thrown by a certain > notation that I see.  I was watching a training course on lynda.com and this > notation was not presented.  For lists, when would you use what appears

Re: Clarification of notation

2010-09-29 Thread alex23
Bruce Whealton wrote: > For lists, when would > you use what appears to be nested lists, like: > [[], [], []] > a list of lists? Well, you'd use it when you'd want a list of lists ;) There's nothing magical about a list of lists, it's just a list with objects inside like any other, in this case

Re: Clarification of notation

2010-09-29 Thread Seebs
On 2010-09-30, Bruce Whealton wrote: > Next, from the documentation I see and this is just an example (this > kind of notation is seen elsewhere in the documentation: > str.count(sub[, start[, end]]) > This particular example is from the string methods. > Is this a nesting of two lists inside a

Clarification of notation

2010-09-29 Thread Bruce Whealton
Hello all, I recently started learning python. I am a bit thrown by a certain notation that I see. I was watching a training course on lynda.com and this notation was not presented. For lists, when would you use what appears to be nested lists, like: [[], [], []] a list of lists? W

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

2010-09-29 Thread Seebs
On 2010-09-30, namekuseijin wrote: > it generates a list from syntax comprehended in list-like syntax! Okay, help me out here. (Killed the crossposting.) I am not understanding how the word applies. I'm fine with it, but I don't see any relation at all between the thing called a list comprehen

Re: Certificate validation with HTTPSConnection

2010-09-29 Thread John Nagle
On 9/29/2010 3:51 PM, Antoine Pitrou wrote: 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_REQUIRE

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

2010-09-29 Thread namekuseijin
On 29 set, 17:46, Xah Lee wrote: > 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,

Strange os.stat behavior

2010-09-29 Thread Philip Bloom
I'm on python 2.6.1: Ran into some os.stat behavior that knocked me for a loop. I was using os.stat to retrieve file st_ctime and st_mtime from a remote server through a unc path, and doing this I encountered that os.stat was returning me st_ctime and st_mtime values that were months off, rep

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

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: "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 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: 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: 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: "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: > >> [...] > >> >> >

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 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:

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: 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: "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: "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 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 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 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: 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: 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: 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: 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: "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: "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: 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 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: 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: (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: (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: 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: 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: 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: 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 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: 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: "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: 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: 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: 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 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: 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: "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: "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: 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: (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: "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: 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: 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: 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: 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

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: 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

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: 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: 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.

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: 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

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 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: 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 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: 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

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

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

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

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

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: 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: 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

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

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

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

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: 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 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: 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: 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: "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

  1   2   >