Re: "Strong typing vs. strong testing"

2010-10-13 Thread Gregory Ewing
RG wrote: Even an interest rate of 0.1 radians makes sense if for some unfathomable reason you want to visualize your interest payment as the relative length of a line segment and an arc. It could even be quite reasonable if you're presenting it as a segment of a pie graph. For what it's wor

Re: Wrong default endianess in utf-16 and utf-32 !?

2010-10-13 Thread jmfauth
On 12 oct, 22:00, John Machin wrote: > jmfauth gmail.com> writes: > > > When an endianess is not specified, (BE, LE, unmarked forms), > > the Unicode Consortium specifies, the default byte serialization > > should be big-endian. > > > Seehttp://www.unicode.org/faq//utf_bom.html > > Q: Which of th

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Gregory Ewing
Dann Corbit wrote: But in a very real sense it is a measure of rotation. We could call it a special measure, sort of like the way that e is a special base compared to all others. That's not the only thing that radians are useful for, though. Consider a weight bobbing up and down on a spring,

Re: Tkinter: Exception RuntimeError: 'maximum recursion depth exceeded'

2010-10-13 Thread Olaf Dietrich
Jeff Hobbs : > On Oct 12, 9:43 am, o...@dtrx.de (Olaf Dietrich) wrote: >> >> After some somewhat heavy mouse action inside the >> canvas (with the left button pressed), the application throws: >> >> | Exception RuntimeError: 'maximum recursion depth exceeded' in > method PhotoImage.__del__ of > >

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article <8hl3grfh2...@mid.individual.net>, Gregory Ewing wrote: > RG wrote: > > Even an interest > > rate of 0.1 radians makes sense if for some unfathomable reason you want > > to visualize your interest payment as the relative length of a line > > segment and an arc. > > It could even b

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article <8hl2ucfdv...@mid.individual.net>, Gregory Ewing wrote: > Tim Bradshaw wrote: > > In general any function > > which raises its argument to more than one power ... doesn't make > > much sense if its argument has units. > > That's not true. Consider the distance travelled by a > fall

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 02:00:46 +0100, BartC said: But what exactly *is* this number? Is it 0.25, 1.57 or 90? Its pi/2, the same way 90% is 9/10. I can also write 12 inches, 1 foot, 1/3 yards, 1/5280 miles, 304.8 mm and so on. They are all the same number, roughly 1/13100 of the polar circumf

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Chris Rebert
On Wed, Oct 13, 2010 at 12:31 AM, RG wrote: > This reminds me of back when I was a kid and my dad was trying to teach > me basic physics.  He kept saying that the acceleration of gravity was > 9.8 meters per second squared and I just couldn't wrap my brain around > what it meant to square a secon

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Gregory Ewing
Philip Semanchuk wrote: Hi Greg, Are you talking about compiling Python itself or extensions? I've managed to get Python itself compiled as 32 bit, and that also seems to take care of extensions built using 'python setup.py ...'. I'm mainly concerned about non-Python libraries that get wrappe

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Gregory Ewing
Jason Swails wrote: Try setting the compiler itself as "gcc -m32" You mean by setting CC? That's a cunning plan -- I'll give it a try. On a related note, according to the man page for Apple's gcc, you're supposed to be able to use both '-arch i386' and '-arch x86_64' at the same time and get f

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Diez B. Roggisch
Gregory Ewing writes: > Philip Semanchuk wrote: > >> Hi Greg, >> Are you talking about compiling Python itself or extensions? > > I've managed to get Python itself compiled as 32 bit, > and that also seems to take care of extensions built > using 'python setup.py ...'. > > I'm mainly concerned ab

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Rob Warnock
RG wrote: +--- | This reminds me of back when I was a kid and my dad was trying to teach | me basic physics. He kept saying that the acceleration of gravity was | 9.8 meters per second squared and I just couldn't wrap my brain around | what it meant to square a second. | | Now th

Re: "Strong typing vs. strong testing"

2010-10-13 Thread RG
In article , r...@rpw3.org (Rob Warnock) wrote: > RG wrote: > +--- > | This reminds me of back when I was a kid and my dad was trying to teach > | me basic physics. He kept saying that the acceleration of gravity was > | 9.8 meters per second squared and I just couldn't wrap my b

Re: subprocess.check_call() fails ... but only on my production machine

2010-10-13 Thread Tim Golden
On 12/10/2010 14:31, Chris Curvey wrote: I've got a python program running on windows that executes a command- line script. The command being executed is: print cmd "C:\Program Files\ImageMagick-6.6.1-Q16\convert.exe" -density 72x72 "c: \temp\choicepoint 2010-01 Stmt_p1.pdf" -quiet -region (6

Re: Help needed - To get path of a directory

2010-10-13 Thread Bishwarup Banerjee
Dear Emmanuel, Thank you for your reply. Actually what I want to do is, at the run time I want to know the location of a specific directory. Then I will add some file name to the path and load the file. The directory can reside in any drive, depending on the user. With Warm Regards, On Wed, Oct

Re: I don't get why sys.exit(1) doesn't exit the while loop in the follow case

2010-10-13 Thread Arnaud Delobelle
Nobody writes: > On Mon, 11 Oct 2010 05:42:39 -0700, Ethan Furman wrote: > If I'm catching exceptions in order to perform clean-up, I'll use a bare except and re-raise the exception afterwards. In that situation, a bare except is usually the right thing to do. >>> >>> Wrong way to do

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Ned Deily
In article <8hl75sf6j...@mid.individual.net>, Gregory Ewing wrote: > On a related note, according to the man page for Apple's > gcc, you're supposed to be able to use both '-arch i386' > and '-arch x86_64' at the same time and get fat binaries. > That would actually be my preferred option, becaus

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Ashish
On Oct 13, 11:11 am, Ashish wrote: > On Oct 12, 6:33 pm, Antoine Pitrou wrote:> On Tue, 12 > Oct 2010 05:40:43 -0700 (PDT) > > > Ashish Vyas wrote: > > > Another observation that I have made is with 10 parallel HTTPS connection > > > each > > > trying 1 transaction per second from 2 different

a test posting

2010-10-13 Thread Ng Spim
Proin molestie porttitor magna, sed ullamcorper nibh eleifend non. Ut posuere condimentum aliquet. Sed luctus aliquam est, vitae sollicitudin diam adipiscing non. Fusce quis nulla vitae odio pulvinar condimentum. Curabitur hendrerit, nisl ut interdum tincidunt, ligula lorem consectetur elit, non fe

Re: Standardizing RPython - it's time.

2010-10-13 Thread Carl Friedrich Bolz
Hi John, John Nagle animats.com> writes: > All attempts to make the dialect defined by CPython significantly > faster have failed. PyPy did not achieve much of a speed > improvement over CPython, and is sometimes slower. This is not true. While PyPy is indeed sometimes slower than CPython

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Stefan Behnel
Ashish Vyas, 12.10.2010 14:40: When I send request using HTTP, I am able to reach 1 transaction (request sent, response rcvd and validated.) per second from 20 parallel connections easily. Average response time shown is about 0.15 seconds. However, when I send request using HTTPS, I am seeing tha

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-13 Thread Antoon Pardon
On Tue, Oct 12, 2010 at 01:50:47PM -0400, Terry Reedy wrote: > >That seems to be an undocumented feature. I didn't know it was possible > >to use extra parameters after key in __getitem__. > > They never get passed, and as I said above, should not have been > there in the version I posted. Sorry

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Antoine Pitrou
On Wed, 13 Oct 2010 02:12:21 -0700 (PDT) Ashish wrote: > > > > > Is the client machine at 100% CPU when you do that? > > > > With HTTP, I see client CPU at appx. 97%. However with HTTPS, it stays > > at 53-55%. And is the server at 100% CPU then? If the client is not at 100% CPU, it shouldn't be

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Ashish
On Oct 13, 2:36 pm, Stefan Behnel wrote: > Ashish Vyas, 12.10.2010 14:40: > > > When I send request using HTTP, I am able to reach 1 transaction (request > > sent, > > response rcvd and validated.) per second from 20 parallel connections > > easily. > > Average response time shown is about 0.15

Re: Tkinter: Exception RuntimeError: 'maximum recursion depth exceeded'

2010-10-13 Thread Lawrence D'Oliveiro
In message , Olaf Dietrich wrote: > If I replace update() by update_idletasks(), the problem > disappears, but unfortunately, considerably fewer events > are recorded on the canvas (when connecting the pixels with > lines, the lines become much longer with update_idletasks() > than with update()).

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Rob Warnock
RG wrote: +--- | r...@rpw3.org (Rob Warnock) wrote: | > Write it our longhand and it's easier to grok: | > 9.8 m/s^2 ==> 9.8 m/(s*s) ==> 9.8 m/(s*s) ==> | > (9.8 meters per second) per second. | > \ / | > \__ speed added __/ per second | | Oh, t

Using csv.DictReader with \r\n in the middle of fields

2010-10-13 Thread pstatham
Hello everyone! Hopefully this will interest some, I have a csv file (can be downloaded from http://www.paulstathamphotography.co.uk/45.txt) which has five fields separated by ~ delimiters. To read this I've been using a csv.DictReader which works in 99% of the cases. Occasionally however the desc

optparser: how to register callback to display binary's help

2010-10-13 Thread hiral
Hi, I want to display help message of python script and then display help message from the binary file (which also supports -h option): Assumptions: 1) 'mybinary' - is linux executable file which supports '-h' and on '- h' option it displays the help message 2) myscript.py - when passing '-h' opt

Re: optparser: how to register callback to display binary's help

2010-10-13 Thread Michele Simionato
Here is a solution using plac (http://pypi.python.org/pypi/plac) and not OptionParse, in the case the Linux underlying command is grep: import subprocess import plac @plac.annotations(help=('show help', 'flag', 'h')) def main(help): if help: script_usage = plac.parser_from(main).forma

Re: "Strong typing vs. strong testing"

2010-10-13 Thread BartC
"RG" wrote in message news:rnospamon-ee76e8.18291912102...@news.albasani.net... In article , "BartC" wrote: "RG" wrote in message > Likewise, all of the following are the same number written in different > notations: > > pi/2 > pi/2 radians > 90 degrees > 100 gradians > 1/4 circle > 0.25

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread Jon Clements
On 12 Oct, 20:21, "J. Gerlach" wrote: > Am 12.10.2010 17:10, schrieb Roy Smith: > > > [A]re there any plans to update the api to allow an iterable instead of > > a sequence? > > sqlite3 (standard library, python 2.6.6., Windows 32Bit) does that already:: > > import sqlite3 as sql > > connection =

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Ashish
On Oct 13, 3:19 pm, Antoine Pitrou wrote: > On Wed, 13 Oct 2010 02:12:21 -0700 (PDT) > > Ashish wrote: > > > > > Is the client machine at 100% CPU when you do that? > > > > With HTTP, I see client CPU at appx. 97%. However with HTTPS, it stays > > > at 53-55%. > > And is the server at 100% CPU th

Re: Tkinter: Exception RuntimeError: 'maximum recursion depth exceeded'

2010-10-13 Thread Olaf Dietrich
Lawrence D'Oliveiro : > In message , Olaf Dietrich wrote: > >> If I replace update() by update_idletasks(), the problem >> disappears, but unfortunately, considerably fewer events >> are recorded on the canvas (when connecting the pixels with >> lines, the lines become much longer with update_idle

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 13:21:29 +0100, BartC said: My money would have been on 0.25, based on using 1.0 for a 360° circular angle. It seems far more attractive than using the arbitrary-looking 6.28... It may look arbitrary, but it isn't: it's about as non-arbitrary as it is possible to be. -- http:

Write Python Book - Packt Publishing.

2010-10-13 Thread Kshipra Singh
Hi All, I represent Packt Publishing, the publishers of computer related books. We are planning to publish a new book on improving the performance of Python applications and are currently looking out for potential authors to write it. You do not need to have any past writing experience. All t

Re: optparser: how to register callback to display binary's help

2010-10-13 Thread Jean-Michel Pichavant
hiral wrote: Hi, I want to display help message of python script and then display help message from the binary file (which also supports -h option): Assumptions: 1) 'mybinary' - is linux executable file which supports '-h' and on '- h' option it displays the help message 2) myscript.py - when p

Re: Performance evaluation of HTTPS library

2010-10-13 Thread Antoine Pitrou
On Wed, 13 Oct 2010 05:27:29 -0700 (PDT) Ashish wrote: > > Well, CBSocket is socket implementation that calls my callback on > data. > Both my classes AsyncHTTPSConnection and AsyncHTTPConnection use it > and use it the same way ( self.sock = CBSocket(sock2) ). > The implemetation of AsyncHTTPCon

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread J. Gerlach
Am 13.10.2010 14:26, schrieb Jon Clements: > On 12 Oct, 20:21, "J. Gerlach" wrote: >> Am 12.10.2010 17:10, schrieb Roy Smith: >> >>> [A]re there any plans to update the api to allow an iterable instead of >>> a sequence? >> >> [sqlite3 example snipped] > > What happens if you do itertools.repeat(

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 14:01:39 +1300, Lawrence D'Oliveiro wrote: > In message <4cb4ba4e$0$1641$742ec...@news.sonic.net>, John Nagle wrote: > >> In general, if you find yourself making millions of SQL database >> requests in a loop, you're doing it wrong. > > I’ve done this. Not millions, but certa

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Steven D'Aprano
Hmmm, my ISP's news software really doesn't like it when I cross-post to more than three newsgroups. So, trying again without comp.lang.c. On Wed, 13 Oct 2010 02:00:46 +0100, BartC wrote: > "RG" wrote in message > news:rnospamon-20651e.17410012102...@news.albasani.net... >> In article , "BartC"

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: >> The formula: circumference = 2 x pi x radius is taught in primary >> schools, yet it's actually a very difficult formula to prove! > > What's to prove? That's the definition of pi. Incorrect -- it's not necessarily so that the ratio of the circum

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Arnaud Delobelle
Tim Bradshaw writes: > On 2010-10-13 13:21:29 +0100, BartC said: > >> My money would have been on 0.25, based on using 1.0 for a 360° >> circular angle. It seems far more attractive than using the >> arbitrary-looking 6.28... > > It may look arbitrary, but it isn't: it's about as non-arbitrary as

send command to parent shell

2010-10-13 Thread Martin Landa
Hi, is there a way how to send command from python script to the shell (known id) from which the python script has been called? More precisely, the goal is to exit running bash (on Linux) or cmd (on Windows) directly from wxPython application, currently user needs to quit wxPython application and

can I use more than one status condition name in imaplib.status()

2010-10-13 Thread harryos
Hi In the signature of of imaplib.status() method MAP4.status(mailbox, names) why is the 'names ' argument plural?Can I pass more than one name to the method? I can get correct result when I call, imapclient.status('Inbox', "(UNSEEN)") or imapclient.status('Inbox', "(RECENT)") Is it possible to

CherryPyWSGIServer multi-threading

2010-10-13 Thread Bart Ogryczak
I'm trying to create multi-threaded WSGI server. But somehow I'm getting single threaded. What am I doing wrong? #start myapp.py from cherrypy.wsgiserver import CherryPyWSGIServer def my_app(environ, start_response): print "my_app" import time for i in range(10): print i

CherryPyWSGIServer multi-threading

2010-10-13 Thread Bart Ogryczak
I'm trying to create multi-threaded WSGI server. But somehow I'm getting single threaded. What am I doing wrong? #start myapp.py from cherrypy.wsgiserver import CherryPyWSGIServer def my_app(environ, start_response): print "my_app" import time for i in range(10): print i

Re: Write Python Book - Packt Publishing.

2010-10-13 Thread Sudheer Satyanarayana
Hello, Apologies for spamming the list. I didn't realize the publisher sent the email to the list. I thought it was a private email and replied to it instantly. -- With warm regards, Sudheer. S Personal home page - http://sudheer.net | Tech Chorus - http://techchorus.net Web and IT service

Re: Write Python Book - Packt Publishing.

2010-10-13 Thread Sudheer Satyanarayana
We are planning to publish a new book on improving the performance of Python applications and are currently looking out for potential authors to write it. You do not need to have any past writing experience. All that we need from our authors is a good knowledge of their subject, a passion to

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Tim Bradshaw
On 2010-10-13 14:20:30 +0100, Steven D'Aprano said: ncorrect -- it's not necessarily so that the ratio of the circumference to the radius of a circle is always the same number. It could have turned out that different circles had different ratios. But pi is much more basic than that, I think.

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Antoon Pardon
On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: > On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: > > >> The formula: circumference = 2 x pi x radius is taught in primary > >> schools, yet it's actually a very difficult formula to prove! > > > > What's to prove? That's the definit

Re: send command to parent shell

2010-10-13 Thread Nobody
On Wed, 13 Oct 2010 06:30:15 -0700, Martin Landa wrote: > is there a way how to send command from python script to the shell > (known id) from which the python script has been called? For Unix, this should work, but in general it's the wrong thing to do: import os import signal

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Steve Schafer
On Wed, 13 Oct 2010 06:05:27 -0500, r...@rpw3.org (Rob Warnock) wrote: >Why should it?!? If you look way under the covers, I suspect that even >the "c^2" in "E = mc^2" is a "collected" term in the above sense [that is, >if I recall my classes in introductory special relativity correctly]. In spec

Re: Tkinter: Exception RuntimeError: 'maximum recursion depth exceeded'

2010-10-13 Thread Jeff Hobbs
On Oct 13, 2:18 am, o...@dtrx.de (Olaf Dietrich) wrote: > Jeff  Hobbs : > > > > > > > On Oct 12, 9:43 am, o...@dtrx.de (Olaf Dietrich) wrote: > > >> After some somewhat heavy mouse action inside the > >> canvas (with the left button pressed), the application throws: > > >> | Exception RuntimeError:

Re: Using csv.DictReader with \r\n in the middle of fields

2010-10-13 Thread Neil Cerutti
On 2010-10-13, pstatham wrote: > Hopefully this will interest some, I have a csv file (can be > downloaded from http://www.paulstathamphotography.co.uk/45.txt) which > has five fields separated by ~ delimiters. To read this I've been > using a csv.DictReader which works in 99% of the cases. Occasi

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Philip Semanchuk
On Oct 13, 2010, at 3:54 AM, Gregory Ewing wrote: > Philip Semanchuk wrote: > >> Hi Greg, >> Are you talking about compiling Python itself or extensions? > > I've managed to get Python itself compiled as 32 bit, > and that also seems to take care of extensions built > using 'python setup.py ...

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Keith Thompson
RG writes: > In article <8hl2ucfdv...@mid.individual.net>, > Gregory Ewing wrote: >> Tim Bradshaw wrote: >> > In general any function >> > which raises its argument to more than one power ... doesn't make >> > much sense if its argument has units. >> >> That's not true. Consider the distance

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Pascal J. Bourguignon
Steven D'Aprano writes: > Hmmm, my ISP's news software really doesn't like it when I cross-post to > more than three newsgroups. So, trying again without comp.lang.c. > > On Wed, 13 Oct 2010 02:00:46 +0100, BartC wrote: > >> "RG" wrote in message >> news:rnospamon-20651e.17410012102...@news.alba

how do I search python mailing list archives?

2010-10-13 Thread Sean Choi
What are the various ways to search the python mailing list archives? -- http://mail.python.org/mailman/listinfo/python-list

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-12, Jonas H. wrote: > Just a few pointers, looks quite good to me for a newbie :) Thanks! > * Less action in __init__. I'm a bit curious about this. The __init__ functions in this are, at least for now, pretty much doing only what's needed to create the objects from their inputs. >

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-12, Chris Rebert wrote: > 2. > self.f = file(path, 'r') > if not self.f: > return None > > The "if" here is pointless; I'm reasonably sure files are always > considered boolean true. I actually seem to have done this wrong anyway -- I was thinking in terms of the C-like idiom of re

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-12, MRAB wrote: > The code does require Python 2 and the use of except ... as ... requires > at least version 2.6. Whoops. > Line 51 > The __init__ method should always return None. There's no need to be > explicit about it, just use a plain "return". The real issue here is that I

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-12, Hallvard B Furuseth wrote: >> list = map(lambda x: x.call(), self.args) >> return ', '.join(list) > > return ', '.join([x.call() for x in self.args]) I think I wrote that before I found out about list comprehensions. How new are list comprehensions? I do like that, it's clearer

Re: PEP 249 (database api) -- executemany() with iterable?

2010-10-13 Thread John Nagle
On 10/12/2010 6:01 PM, Lawrence D'Oliveiro wrote: In message<4cb4ba4e$0$1641$742ec...@news.sonic.net>, John Nagle wrote: In general, if you find yourself making millions of SQL database requests in a loop, you're doing it wrong. I’ve done this. Not millions, but certainly on the order of tens

Re: Difficulty in easy_install

2010-10-13 Thread John Nagle
On 10/11/2010 1:45 AM, sankalp srivastava wrote: I am having difficulty in easy_installing I use a proxy server and strange errors , like it can't fetch the package is showing up . the package is pyspeech ...please help me :( I don't know if the proxy server is causing the problems , in linux

Re: My first Python program

2010-10-13 Thread Chris Rebert
On Wed, Oct 13, 2010 at 9:56 AM, Seebs wrote: > On 2010-10-12, MRAB wrote: >> Line 51 > >> The __init__ method should always return None. There's no need to be >> explicit about it, just use a plain "return". > > The real issue here is that I was assuming that open('nonexistent') returned > None

Re: how do I search python mailing list archives?

2010-10-13 Thread Daniel Fetchinson
> What are the various ways to search the python mailing list archives? If you are searching for 'foo' and 'bar' you can try this in google: foo bar site:mail.python.org inurl:python-list Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.or

Re: My first Python program

2010-10-13 Thread Ethan Furman
Seebs wrote: On 2010-10-12, Hallvard B Furuseth wrote: > self.type, self.name = None, None Actually you can write self.type = self.name = None, though assignment statements are more limited than in C. (And I think they're assigned left-to-right.) Python 2.5.4 (r254:67916, Dec 23 2008, 15:

Re: if the else short form

2010-10-13 Thread John Nagle
On 10/10/2010 6:46 PM, Lawrence D'Oliveiro wrote: Languages that insisted on being able to do proper compiler-level cross checks between separately-compiled modules (e.g. Modula-2, Ada) never really became that popular. This saddened me. It's an sad consequence of a UNIX mindset that "you c

Re: My first Python program

2010-10-13 Thread Jean-Michel Pichavant
Seebs wrote: So, I'm new to Python, though I've got a bit of experience in a few other languages. My overall impressions are pretty mixed, but overall positive; it's a reasonably expressive language which has a good mix between staying out of my way and taking care of stuff I don't want to waste

Re: My first Python program

2010-10-13 Thread MRAB
On 13/10/2010 18:17, Chris Rebert wrote: On Wed, Oct 13, 2010 at 9:56 AM, Seebs wrote: On 2010-10-12, MRAB wrote: Line 51 The __init__ method should always return None. There's no need to be explicit about it, just use a plain "return". The real issue here is that I was assuming that o

Re: My first Python program

2010-10-13 Thread Jonas H.
On 10/13/2010 06:48 PM, Seebs wrote: Is it safe for me to assume that all my files will have been flushed and closed? I'd normally assume this, but I seem to recall that not every language makes those guarantees. Not really. Files will be closed when the garbage collector collects the file ob

Re: how do I search python mailing list archives?

2010-10-13 Thread Ned Deily
In article , Daniel Fetchinson wrote: > > What are the various ways to search the python mailing list archives? > > If you are searching for 'foo' and 'bar' you can try this in google: > > foo bar site:mail.python.org inurl:python-list The mailing list is also mirrored at gmane.org under the

Re: My first Python program

2010-10-13 Thread Ian Kelly
On Wed, Oct 13, 2010 at 11:28 AM, Ethan Furman wrote: > Seebs wrote: > >> On 2010-10-12, Hallvard B Furuseth wrote: >> > > > >> self.type, self.name = None, None >>> >> Actually you can write self.type = self.name = None, >>> though assignment statements are more limited than in C. >>> (A

Re: My first Python program

2010-10-13 Thread Chris Torek
In article Seebs wrote: >> * raising `Exception` rather than a subclass of it is uncommon. > >Okay. I did that as a quick fix when, finally having hit one of them, >I found out that 'raise "Error message"' didn't work. :) I'm a bit unsure >as to how to pick the right subclass, though. For ex

Re: My first Python program

2010-10-13 Thread Chris Torek
In article Jonas H. wrote: >On 10/13/2010 06:48 PM, Seebs wrote: >> Is it safe for me to assume that all my files will have been flushed and >> closed? I'd normally assume this, but I seem to recall that not every >> language makes those guarantees. > >Not really. Files will be closed when the g

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-13, Chris Rebert wrote: > For future reference, the significant majority of things in Python > raise exceptions upon encountering errors rather than returning error > values of some sort. Yes. I'm getting used to that -- it's a bit of a shift, because I'm used to exceptions being *exc

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 15:07:07 +0100, Tim Bradshaw wrote: > On 2010-10-13 14:20:30 +0100, Steven D'Aprano said: > >> ncorrect -- it's not necessarily so that the ratio of the circumference >> to the radius of a circle is always the same number. It could have >> turned out that different circles had

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-13, Jean-Michel Pichavant wrote: > If you wonder about some defects reported by such linters, you can then > ask in this list why something is not that good, because it may not be > always obvious. > 'pylint' is one them, pretty effective. Okay, several questions about stuff pylint

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-13, Jonas H. wrote: > Not really. Files will be closed when the garbage collector collects the > file object, but you can't be sure the GC will run within the next N > seconds/instructions or something like that. So you should *always* make > sure to close files after using them. Tha

Re: My first Python program

2010-10-13 Thread Seebs
On 2010-10-13, Chris Torek wrote: > Unfortunately "with" is newish and this code currently has to > support python 2.3 (if not even older versions). I think it might be 2.4 and later. I'm not sure. Of course, this being the real world, the chances that I'll be able to stick with "Python 2" and

Re: My first Python program

2010-10-13 Thread Chris Kaynor
On Wed, Oct 13, 2010 at 12:10 PM, Seebs wrote: > On 2010-10-13, Jean-Michel Pichavant wrote: > > If you wonder about some defects reported by such linters, you can then > > ask in this list why something is not that good, because it may not be > > always obvious. > > > 'pylint' is one them, pret

Re: My first Python program

2010-10-13 Thread Chris Kaynor
On Wed, Oct 13, 2010 at 12:13 PM, Seebs wrote: > On 2010-10-13, Chris Torek wrote: > > Unfortunately "with" is newish and this code currently has to > > support python 2.3 (if not even older versions). > > I think it might be 2.4 and later. I'm not sure. Of course, this being > the real world,

Re: My first Python program

2010-10-13 Thread Chris Kaynor
On Wed, Oct 13, 2010 at 12:12 PM, Seebs wrote: > On 2010-10-13, Jonas H. wrote: > > Not really. Files will be closed when the garbage collector collects the > > file object, but you can't be sure the GC will run within the next N > > seconds/instructions or something like that. So you should *al

Re: My first Python program

2010-10-13 Thread MRAB
On 13/10/2010 20:03, Seebs wrote: On 2010-10-13, Chris Rebert wrote: For future reference, the significant majority of things in Python raise exceptions upon encountering errors rather than returning error values of some sort. Yes. I'm getting used to that -- it's a bit of a shift, because I

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: > On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: >> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: >> >> >> The formula: circumference = 2 x pi x radius is taught in primary >> >> schools, yet it's actually a very difficult

how to add patch

2010-10-13 Thread jimgardener
hi I have some demo python code hosted on a public host that uses subversion..and I want to modify one of the files using a patch file handed to me by another person..How do I do this?Generally I checkout the code and make the change and then commit again..I have never done through patch..Can some

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Steven D'Aprano
On Wed, 13 Oct 2010 17:28:42 +0200, Pascal J. Bourguignon wrote: >>> But what exactly *is* this number? Is it 0.25, 1.57 or 90? >> >> That's the wrong question. It's like asking, what exactly "is" the >> number twenty-one -- is it "one and twenty", or 21, or 0x15, or 0o25, >> or 21.0, or 20.999...

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Aleksej Saushev
"BartC" writes: > "Thomas A. Russ" wrote in message > news:ymi1v7vgyp8@blackcat.isi.edu... >> torb...@diku.dk (Torben ZÆgidius Mogensen) writes: >> >>> Trigonometric functions do take arguments of particular units: radians >>> or (less often) degrees, with conversion needed if you use the "w

Re: how to add patch

2010-10-13 Thread Jason Swails
On Wed, Oct 13, 2010 at 3:36 PM, jimgardener wrote: > hi > I have some demo python code hosted on a public host that uses > subversion..and I want to modify one of the files using a patch file > handed to me by another person..How do I do this?Generally I checkout > the code and make the change

Exceptions are not just for errors (was: My first Python program)

2010-10-13 Thread Ben Finney
Seebs writes: > On 2010-10-13, Chris Rebert wrote: > > For future reference, the significant majority of things in Python > > raise exceptions upon encountering errors rather than returning > > error values of some sort. > > Yes. I'm getting used to that -- it's a bit of a shift, because I'm >

Re: My first Python program

2010-10-13 Thread Ben Finney
Seebs writes: > 1. If I have a message that I wish to print, it is quite possible that > message + indentation exceeds 80 lines. What's the idiomatic way to > solve this? Do I just break the string up into parts, or do I just > accept that some lines are over 80 characters, or what? Python borro

Re: "Strong typing vs. strong testing" [OT]

2010-10-13 Thread Arnaud Delobelle
Steven D'Aprano writes: > On Wed, 13 Oct 2010 16:17:19 +0200, Antoon Pardon wrote: > >> On Wed, Oct 13, 2010 at 01:20:30PM +, Steven D'Aprano wrote: >>> On Tue, 12 Oct 2010 22:13:26 -0700, RG wrote: >>> >>> >> The formula: circumference = 2 x pi x radius is taught in primary >>> >> schools,

Hyperlink to a file using python

2010-10-13 Thread Pratik Khemka
I want to create a hyperlink in my excel sheet using python such that when you click on that link (which is a file name (html file)), the file automatically opens. This file is present in the same folder in which the python code file is present. I am using xlwt module link= 'abcd.html'

Re: Exceptions are not just for errors (was: My first Python program)

2010-10-13 Thread Emmanuel Surleau
> Seebs writes: > > On 2010-10-13, Chris Rebert wrote: > > > For future reference, the significant majority of things in Python > > > raise exceptions upon encountering errors rather than returning > > > error values of some sort. > > > > Yes. I'm getting used to that -- it's a bit of a shift,

Re: Scheme as a virtual machine?

2010-10-13 Thread namekuseijin
On 11 out, 08:49, Oleg Parashchenko wrote: > Hello, > > I'd like to try the idea that Scheme can be considered as a new > portable assembler. We could code something in Scheme and then compile > it to PHP or Python or Java or whatever. > > Any suggestions and pointers to existing and related work

Re: Hyperlink to a file using python

2010-10-13 Thread Chris Rebert
On Wed, Oct 13, 2010 at 1:57 PM, Pratik Khemka wrote: > I want to create a hyperlink in my excel sheet using python such that when > you click on that link (which is a file name (html file)), the file > automatically opens. This file is present in the same folder in which the > python code file is

Re: "Strong typing vs. strong testing"

2010-10-13 Thread Gregory Ewing
RG wrote: I just couldn't wrap my brain around what it meant to square a second. That's nothing. Magnetic permeability is measured in newtons per square amp... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Hyperlink to a file using python

2010-10-13 Thread Emile van Sebille
On 10/13/2010 1:57 PM Pratik Khemka said... I want to create a hyperlink in my excel sheet using python such that when you click on that link (which is a file name (html file)), the file automatically opens. This file is present in the same folder in which the python code file is present. I

Re: My first Python program

2010-10-13 Thread Hallvard B Furuseth
Ethan Furman writes: >Seebs wrote: >>On 2010-10-12, Hallvard B Furuseth wrote: self.type, self.name = None, None >> >>> Actually you can write self.type = self.name = None, >>> though assignment statements are more limited than in C. >>> (And I think they're assigned left-to-right.) > > Pytho

PyCharm

2010-10-13 Thread Robert H
Since the new IDE from Jetbrains is out I was wondering if "you" are using it and what "you" think about it. I have to start learning Python for a project at work and I am looking around for options. Bob -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >