Re: "Strong typing vs. strong testing"

2010-09-30 Thread Ian Collins
On 09/30/10 06:38 PM, Lie Ryan wrote: The /most/ correct version of maximum() function is probably one written in Haskell as: maximum :: Integer -> Integer -> Integer maximum a b = if a> b then a else b Integer in Haskell has infinite precision (like python's int, only bounded by memory), b

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > Yes.  Nonetheless, the maximum() function does exactly what it is intended > > to do *with the inputs it receives*.  The failure is outside the function; > > it did the right thing with the data actually passed to it, the problem > > was a user misunderstanding as to what data were being passe

Re: System idle time under Linux

2010-09-30 Thread Lawrence D'Oliveiro
In message , Hugo Léveillé wrote: > Sorry, I am not a linux guy. Did not know it was a text file That’s why I said to check the proc(5) man page for further details. -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Paul Rubin
>> > > > 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. If someone >> > > > tries to call it incorrectly it is a compile error. > The second sentence is not disproved by a cast from one datatype to > another (which c

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
Ian Collins writes: > On 09/30/10 06:38 PM, Lie Ryan wrote: >> >> The /most/ correct version of maximum() function is probably one written >> in Haskell as: >> >> maximum :: Integer -> Integer -> Integer >> maximum a b = if a> b then a else b >> >> Integer in Haskell has infinite precision (li

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Hugo Léveillé heeft het volgende neergekrabbeld: > > Thanks, will take a closer look on that > > But to get me started, how would you get, via python, the info from that From a unix command prompt use the cat command to view their contents. You'll notice that they plain text files with very in

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Ifrit heeft het volgende neergekrabbeld: > Hugo Léveillé heeft het volgende neergekrabbeld: > >> >> Thanks, will take a closer look on that >> >> But to get me started, how would you get, via python, the info from that > > From a unix command prompt use the cat command to view their contents.

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article <5bf24e59-1be0-4d31-9fa7-c03a8bf9b...@y12g2000prb.googlegroups.com>, TheFlyingDutchman wrote: > > > Yes.  Nonetheless, the maximum() function does exactly what it is intended > > > to do *with the inputs it receives*.  The failure is outside the function; > > > it did the right thing

Re: how to get partition information of a hard disk with python

2010-09-30 Thread Anssi Saari
Nobody writes: > On Wed, 22 Sep 2010 00:31:04 +0200, Hellmut Weber wrote: > >> I'm looking for a possibility to access the partiton inforamtion of a >> hard disk of my computer from within a python program. > > Have you considered parsing /proc/partitions? One could also just read the partition

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
On Sep 30, 1:02 am, Paul Rubin wrote: > >> > > > 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. If someone > >> > > > tries to call it incorrectly it is a compile error. > > The second sentence is not disproved by

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Lie Ryan
On 09/30/10 16:09, TheFlyingDutchman wrote: > >> >> 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 -- >> i

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
On Sep 30, 1:40 am, RG wrote: > In article > <5bf24e59-1be0-4d31-9fa7-c03a8bf9b...@y12g2000prb.googlegroups.com>, > > > > > >  TheFlyingDutchman wrote: > > > > Yes.  Nonetheless, the maximum() function does exactly what it is > > > > intended > > > > to do *with the inputs it receives*.  The fai

Re: utf-8 and ctypes

2010-09-30 Thread Diez B. Roggisch
Brendan Miller writes: > 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 p

install 3.1

2010-09-30 Thread roronron
My python installed but the gui gives me syntax error on any code I type or paste in. Newbie needs help. -- http://mail.python.org/mailman/listinfo/python-list

Re: install 3.1

2010-09-30 Thread Chris Rebert
On Thu, Sep 30, 2010 at 2:02 AM, roronron wrote: > My python installed but the gui gives me syntax error on any code I type > or paste in. Newbie needs help. Post the full, exact text of the error message. See also: http://www.catb.org/esr/faqs/smart-questions.html Cheers, Chris -- http://mail.

Re: System idle time under Linux

2010-09-30 Thread John Pinner
On Sep 29, 7:36 pm, Hugo Léveillé wrote: > 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 The command who -Hu). will give you idle time for each logged-in user ( H - print

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal Costanza
On 30/09/2010 08:09, TheFlyingDutchman wrote: 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 unco

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Ian Collins
On 09/30/10 09:02 PM, Paul Rubin wrote: int maximum(int a, int b); int foo() { int (*barf)() = maximum; return barf(3); } This compiles fine for me. Where is the cast? Where is the error message? Are you saying barf(3) doesn't call maximum? Try a language with

Re: how to get partition information of a hard disk with python

2010-09-30 Thread Nobody
On Thu, 30 Sep 2010 11:41:48 +0300, Anssi Saari wrote: >>> I'm looking for a possibility to access the partiton inforamtion of a >>> hard disk of my computer from within a python program. >> >> Have you considered parsing /proc/partitions? > > One could also just read the partition table directly

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > > "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. " > > > Dynamic typed languages like Python fail in this case on "Never blows > > up". > > How do you define "Never blows up"? Never has execution halt. I think a k

gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
I'm having a weird problem with the 'External Tools' plugin for gedit, that seems to get weirder the more I dig into it. When I start gedit by clicking a launcher (from the Ubuntu menu, panel or desktop) everything is dandy and the 'External Tools' plugin works as expected. When gedit is launched f

Re: if the else short form

2010-09-30 Thread Sion Arrowsmith
Andreas Waldenburger wrote: > >[ ... ] >Boolean values behave like the values 0 and 1, respectively, in >almost all contexts, the exception being that when converted to a >string, the strings

will Gnome 3.0 kill pygtk?

2010-09-30 Thread Tracubik
Hi! It seem that the new version of gnome 3.0 will dismiss pygtk support. link: [1] http://live.gnome.org/TwoPointNinetyone/ (search killing pygtk) [2] http://live.gnome.org/GnomeGoals/PythonIntrospectionPorting i'm studying pygtk right now, am i wasting my time considering that my preferr

Re: if the else short form

2010-09-30 Thread bruno.desthuilli...@gmail.com
On 29 sep, 19:20, Seebs wrote: > On 2010-09-29, Tracubik wrote: > > button = gtk.Button(("False,", "True,")[fill==True]) > Oh, what a nasty idiom. > Well, it's not very different from dict-based dispatch , which is the core of OO polymorphic dispatch in quite a few dynamic OOPLs. Anyway, it's

Re: System idle time under Linux

2010-09-30 Thread Hugo Léveillé
Ok after some testing, what the who -Hu is giving me is the idle time of each running open shell. The first line always return a "?" as the IDLE time. ex: NAME LINE TIME IDLE PID COMMENT vg0619hl :0 2010-09-30 06:10 ? 13091 vg0619hl pts/1

sys.setrecursionlimit() and regular expressions

2010-09-30 Thread Santiago Caracol
Hello, in my program I use recursive functions. A recursion limit of 10 would be by far sufficient. Yet, I also use some (not very complicated) regular expressions, which only compile if I set the recursion limit to 100, or so. This means, of course, an unnecessary loss of speed. Can I use one re

Re: PyCObject & malloc creating memory leak

2010-09-30 Thread Tom Conneely
Thanks for your reply, you've given me plenty to think about On Sep 29, 11:51 pm, Antoine Pitrou 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 r

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
bah, I meant to say I'm running "a fully updated ubuntu lucid lynx (10.4)". -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.setrecursionlimit() and regular expressions

2010-09-30 Thread Peter Otten
Santiago Caracol wrote: > in my program I use recursive functions. A recursion limit of 10 would > be by far sufficient. Yet, I also use some (not very complicated) > regular expressions, which only compile if I set the recursion limit > to 100, or so. This means, of course, an unnecessary loss of

Re: sys.setrecursionlimit() and regular expressions

2010-09-30 Thread Santiago Caracol
> Why do you think so? The recursion limit has no effect on the speed of your > script. It's just a number that the interpreter checks against. Yes, sorry. I was just about to explain that. The 'of course' in my post was silly. In MY program, the recursion limit is relevant for performance, beca

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Peter Otten
Joel Hedlund wrote: > I'm having a weird problem with the 'External Tools' plugin for gedit, > that seems to get weirder the more I dig into it. When I start gedit > by clicking a launcher (from the Ubuntu menu, panel or desktop) > everything is dandy and the 'External Tools' plugin works as expec

Re: sequence multiplied by -1

2010-09-30 Thread Antoon Pardon
On Sun, Sep 26, 2010 at 03:20:18PM +, Grant Edwards wrote: > On 2010-09-26, Paul Rubin wrote: > > Steven D'Aprano writes: > >> There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", > > > Why would it not be ["spam","spam","spam"] or even "ssspppaaammm"? > > Because > >

PyRTF object model

2010-09-30 Thread Rustom Mody
I am trying to use PyRTF. I gather that an RTF doc consists of a list of sections, a section consists of a list of paras, paras seem to be just text (not sure on that one) Some questions: When does one end one section and start another? How does one handle lists (as in numbered, bulleted etc)? -

Re: sys.setrecursionlimit() and regular expressions

2010-09-30 Thread Peter Otten
Santiago Caracol wrote: > >> Why do you think so? The recursion limit has no effect on the speed of >> your script. It's just a number that the interpreter checks against. > > Yes, sorry. I was just about to explain that. The 'of course' in my > post was silly. > > In MY program, the recursion

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Nick Keighley
On 27 Sep, 20:29, p...@informatimago.com (Pascal J. Bourguignon) wrote: > namekuseijin writes: > > Fact is:  almost all user data from the external words comes into > > programs as strings.  No typesystem or compiler handles this fact all > > that graceful... > > I would even go further. > > Ty

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
How do I catch output to stdout/stderr when launching from a launcher? I added this to /usr/lib/gedit-2/plugins/externaltools/__init__.py: import sys f = open('/tmp/eraseme.txt', 'w') print >> f, "The executable is %r." % sys.executable f.close() In both cases (launcher/termial) the contents of

Re: PyCObject & malloc creating memory leak

2010-09-30 Thread Tom Conneely
I'm posting this last message as I've found the source of my initial memory leak problem, unfortunately it was an embarrassingly basic mistake. In my defence I've got a horrible cold, but I'm just making excuses. I begin by mallocing the memory, which gives me a pointer "foo" to that memory: c

Re: toy list processing problem: collect similar terms

2010-09-30 Thread namekuseijin
On 29 set, 11:04, w_a_x_man wrote: > 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 to

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Nick Keighley
On 30 Sep, 11:14, TheFlyingDutchman wrote: > > > "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. " > > > > Dynamic typed languages like Python fail in this case on "Never blows > > > up". > > > How do you define "Never

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
FOUND IT! I added the line print >> f, '\n'.join(sorted(sys.path)) and diff:ed the files produced from terminal/launcher. When using the launcher, changes to PYTHONPATH done in ~/.bashrc are not picked up, and I apparently had an old reference to /usr/lib/ python2.4 sitting in there. Removed it

Re: will Gnome 3.0 kill pygtk?

2010-09-30 Thread Neil Hodgson
Tracubik: > i'm studying pygtk right now, am i wasting my time considering that my > preferred platform is linux/gnome? I expect the dynamic binding will be very similar to the current static binding but easier to keep up-to-date. There's already some use of dynamic binding in the recent PyGT

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
I guess the moral of the story is don't always dist-upgrade. Reformat once in a while to remove old forgotten garbage. Clear the blood clots from your systems, so to say. -- http://mail.python.org/mailman/listinfo/python-list

Re: will Gnome 3.0 kill pygtk?

2010-09-30 Thread Diez B. Roggisch
Tracubik writes: > Hi! > It seem that the new version of gnome 3.0 will dismiss pygtk support. > > link: > > [1] http://live.gnome.org/TwoPointNinetyone/ (search killing pygtk) > > [2] http://live.gnome.org/GnomeGoals/PythonIntrospectionPorting > > > i'm studying pygtk right now, am i wasting

Re: Python becoming orphaned over ssh

2010-09-30 Thread David
On Wed, Sep 29, 2010 at 6:49 PM, John Nagle wrote: >   Python's signal handling for multithread and multiprocess programs > leaves something to be desired. > Thanks for the confirmation (that I'm not missing something obvious). I've reported a bug for this behavior in the Python issue tracker.

Re: PyCObject & malloc creating memory leak

2010-09-30 Thread Antoine Pitrou
On Thu, 30 Sep 2010 04:06:03 -0700 (PDT) Tom Conneely wrote: > Thanks for your reply, you've given me plenty to think about > > On Sep 29, 11:51 pm, Antoine Pitrou wrote: > > > > > My original plan was to have the data processing and data acquisition > > > functions running in separate processes

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal Bourguignon
TheFlyingDutchman writes: > In this example RG is passing a long literal greater than INT_MAX to a > function that takes an int and the compiler apparently didn't give a > warning about the change in value as it created the cast to an int, > even with the option -Wall (all warnings). I think it's

Re: Clarification of notation

2010-09-30 Thread Bruce W.
So, this kind of notation would be different: args[0][2] verses args[[0][2]] the latter is multidimensional. Can you think of example of using this type of list? I don't know why this had me a bit confused. I've got to get into programming more... I had done more in the past. Bruce Chriebe

Re: PyRTF object model

2010-09-30 Thread Eric Brunel
In article , Rustom Mody wrote: > I am trying to use PyRTF. > > I gather that an RTF doc consists of a list of sections, a section > consists of a list of paras, > paras seem to be just text (not sure on that one) They also include a style, not only text. > Some questions: > > When does one

Re: toy list processing problem: collect similar terms

2010-09-30 Thread namekuseijin
On 30 set, 09:35, namekuseijin wrote: > On 29 set, 11:04, w_a_x_man wrote: > > > > > 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 sublis

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Peter Otten
Joel Hedlund wrote: > FOUND IT! Heureka! > I added the line > > print >> f, '\n'.join(sorted(sys.path)) > > and diff:ed the files produced from terminal/launcher. > > When using the launcher, changes to PYTHONPATH done in ~/.bashrc are > not picked up, and I apparently had an old reference to

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal Bourguignon
Nick Keighley writes: > On 27 Sep, 20:29, p...@informatimago.com (Pascal J. Bourguignon) > wrote: >> If you start with the mindset of static type checking, you will consider >> that your types are checked and if the types at the interface of two >> modules matches you'll think that everything's o

Re: sequence multiplied by -1

2010-09-30 Thread Emile van Sebille
On 9/30/2010 5:10 AM Antoon Pardon said... On Sun, Sep 26, 2010 at 03:20:18PM +, Grant Edwards wrote: On 2010-09-26, Paul Rubin wrote: Steven D'Aprano writes: There's nothing obscure or unintuitive about "spam"*3 = "spamspamspam", Why would it not be ["spam","spam","spam"] or even "ss

Re: Python becoming orphaned over ssh

2010-09-30 Thread Jean-Paul Calderone
On Sep 30, 9:08 am, David wrote: > On Wed, Sep 29, 2010 at 6:49 PM, John Nagle wrote: > >   Python's signal handling for multithread and multiprocess programs > > leaves something to be desired. > > Thanks for the confirmation (that I'm not missing something obvious). > > I've reported a bug for

Re: if the else short form

2010-09-30 Thread Emile van Sebille
On 9/30/2010 3:21 AM Sion Arrowsmith said... Andreas Waldenburger wrote: [ ... ] Boolean values behave like the values 0 and 1, respectively, in almost all contexts, the exception being that wh

Re: Determine sockets in use by python

2010-09-30 Thread Jean-Paul Calderone
On Sep 29, 4:08 pm, Jim Mellander wrote: > > On Wed, Sep 29, 2010 at 11:05 AM, Gary Herron wrote: > > 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 communicati

Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
> > > If I had to choose between "blow up" or "invalid answer" I would pick > > "invalid answer". > > there are some application domains where neither option would be > viewed as a satisfactory error handling strategy. Fly-by-wire, petro- > chemicals, nuclear power generation. Hell you'd expect be

eval string

2010-09-30 Thread Brandon Harris
Needing to pass a string command into a third party program and having issues creating a string to do what I need. here's what I have so far. eval('import sys; sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\n\n\n\');') Traceback (

Re: Clarification of notation

2010-09-30 Thread Dave Angel
On 2:59 PM, Bruce W. wrote: So, this kind of notation would be different: args[0][2] verses args[[0][2]] the latter is multidimensional. Can you think of example of using this type of list? I don't know why this had me a bit confused. I've got to get into programming more... I had done mo

Re: eval string

2010-09-30 Thread Peter Otten
Brandon Harris wrote: > Needing to pass a string command into a third party program and having > issues creating a string to do what I need. > > here's what I have so far. > > eval('import sys; > sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted!!!\nCompleted!!! \nCompleted!!!\nCompleted!!!\nCo

Re: eval string

2010-09-30 Thread Thomas Jollans
On Thursday 30 September 2010, it occurred to Brandon Harris to exclaim: > Needing to pass a string command into a third party program and having > issues creating a string to do what I need. > > here's what I have so far. > > eval('import sys; > sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Nick Keighley
On 30 Sep, 15:24, TheFlyingDutchman wrote: > > > If I had to choose between "blow up" or "invalid answer" I would pick > > > "invalid answer". > > > there are some application domains where neither option would be > > viewed as a satisfactory error handling strategy. Fly-by-wire, petro- > > chemic

Re: eval string

2010-09-30 Thread Peter Otten
Peter Otten wrote: > exec 'import sys\nsys.stderr.write("completed!\n")' Oops, you need to escape the backslashes for newlines inside quotes inside quotes: >>> exec 'import sys\nsys.stderr.write("completed!\\n")' completed! Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Tim Bradshaw
On 2010-09-30 13:36:17 +0100, Nick Keighley said: there are some application domains where neither option would be viewed as a satisfactory error handling strategy. Fly-by-wire, petro- chemicals, nuclear power generation. Hell you'd expect better than this from your phone! People always give t

Re: PyRTF object model

2010-09-30 Thread David Robinow
On Thu, Sep 30, 2010 at 8:14 AM, Rustom Mody wrote: > I am trying to use PyRTF. > > I gather that an RTF doc consists of a list of sections, a section > consists of a list of paras, > paras seem to be just text (not sure on that one) > > Some questions: > > When does one end one section and start

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
RG writes: [...] > You can't have it both ways. Either I am calling it incorrectly, in > which case I should get a compiler error, or I am calling it correctly, > and I should get the right answer. That I got neither does in fact > falsify the claim. The only way out of this is to say that

Problems with wsgi Python3

2010-09-30 Thread hidura
Hello list, i had seriously troubles with the connection between a form and the wsgi, i' ve made an application on Python3 and was running perfectly but when i try to use the to pass the data this can't be see on the server, so what is your recommendation?, i am open to all the ideas less

Re: Problems with wsgi Python3

2010-09-30 Thread Diez B. Roggisch
hid...@gmail.com writes: > Hello list, i had seriously troubles with the connection between a form and > the > wsgi, i' ve made an application on Python3 and was running perfectly but when > i > try to use the to pass the data this can't be see on the server, so > what > is your recommendation

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, TheFlyingDutchman wrote: > even with the option -Wall (all warnings). For various historical reasons, "-Wall" has the semantics you might expect from an option named "-Wsome-common-warnings-but-not-others". -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > We lost some important context somewhere along the line: >> > > 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. If someone >> > > tries to call it incorrectly it is a compile error. > Pleas

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, Paul Rubin wrote: > int maximum(int a, int b); > > int foo() { > int (*barf)() = maximum; > return barf(3); > } > This compiles fine for me. Where is the cast? On the first line of code inside foo(). > Where is the error message? You chose to use a form

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > You can't have it both ways. Either I am calling it incorrectly, in > which case I should get a compiler error, You get a warning if you ask for it. If you choose to run without all the type checking on, that's your problem. -s -- Copyright 2010, all wrongs reverse

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, Pascal Bourguignon wrote: > Nick Keighley writes: >> do you have any evidence that this is actually so? That people who >> program in statically typed languages actually are prone to this "well >> it compiles so it must be right" attitude? > Yes, I can witness that it's in the min

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Keith Thompson wrote: > RG writes: > [...] > > You can't have it both ways. Either I am calling it incorrectly, in > > which case I should get a compiler error, or I am calling it correctly, > > and I should get the right answer. That I got neither does in fact > > falsify the

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Peter Keller
In comp.lang.lisp TheFlyingDutchman wrote: > >> >> 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-

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, Lie Ryan wrote: > On 09/30/10 16:09, TheFlyingDutchman wrote: >> Dynamic typed languages like Python fail in this case on "Never blows >> up". > How do you define "Never blows up"? I would say "blow up" would be "raise an exception". > Personally, I'd consider maximum(8589934592,

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Seebs wrote: > On 2010-09-30, RG wrote: > > You can't have it both ways. Either I am calling it incorrectly, in > > which case I should get a compiler error, > > You get a warning if you ask for it. If you choose to run without all > the type checking on, that's your problem.

Re: install 3.1

2010-09-30 Thread Chris Rebert
> On Thu, Sep 30, 2010 at 4:16 PM, Chris Rebert wrote: >> On Thu, Sep 30, 2010 at 2:02 AM, roronron wrote: >> > My python installed but the gui gives me syntax error on any code I type >> > or paste in. Newbie needs help. >> >> Post the full, exact text of the error message. >> See also: http://w

Please help: pylint does not work with Emacs23 on Windows

2010-09-30 Thread Dsrt Egle
Hi, I am trying to use Pylint with Emacs on Windows XP. My Emacs version is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install pylint, I added the code block below to Emacs init file, copied form Emacs Wiki. (when (load "flymake" t) (defun flymake-pylint-init ()

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Seebs wrote: > On 2010-09-30, Lie Ryan wrote: > > On 09/30/10 16:09, TheFlyingDutchman wrote: > >> Dynamic typed languages like Python fail in this case on "Never blows > >> up". > > > How do you define "Never blows up"? > > I would say "blow up" would be "raise an exception". >

Re: Please help: pylint does not work with Emacs23 on Windows

2010-09-30 Thread Dsrt Egle
On Sep 30, 9:38 am, Dsrt Egle wrote: > Hi, > > I am trying to use Pylint with Emacs on Windows XP. My Emacs version > is EmacsW32 23.1, pylint is 0.21.3 with Python 2.5. After easy_install > pylint, I added the code block below to Emacs init file, copied form > Emacs Wiki. > >     (when (load "fly

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > My code compiles with no warnings under gcc -Wall. That's nice. gcc -Wall uses only a small subset of warnings that fit the usual expectations of C code that's trying to work on common architectures. >> 2. The constant is not of type int, and the compiler will warn y

namespace hacking question

2010-09-30 Thread kj
This is a recurrent situation: I want to initialize a whole bunch of local variables in a uniform way, but after initialization, I need to do different things with the various variables. What I end up doing is using a dict: d = dict() for v in ('spam', 'ham', 'eggs'): d[v] = init(v) foo(d

Re: install 3.1

2010-09-30 Thread Andreas Waldenburger
On Thu, 30 Sep 2010 09:39:08 -0700 Chris Rebert wrote: > On Thu, Sep 30, 2010 at 2:57 AM, ronald brown > wrote: > print 'Hello, world!' > > SyntaxError: invalid syntax > > > Installed 3 times. Used uninstall in program files and control > > panel. Followed directions on video for 3.1 >

Re: namespace hacking question

2010-09-30 Thread bruno.desthuilli...@gmail.com
On 30 sep, 19:07, kj wrote: > This is a recurrent situation: I want to initialize a whole bunch > of local variables in a uniform way, but after initialization, I > need to do different things with the various variables. > > What I end up doing is using a dict: > > d = dict() > for v in ('spam', '

Re: namespace hacking question

2010-09-30 Thread MRAB
On 30/09/2010 18:07, kj wrote: This is a recurrent situation: I want to initialize a whole bunch of local variables in a uniform way, but after initialization, I need to do different things with the various variables. What I end up doing is using a dict: d = dict() for v in ('spam', 'ham', '

Re: problem in Gasp !

2010-09-30 Thread Cousin Stanley
n.a.s wrote: > I want to ask about graphics using Gasp .Attached is exercise 10 > (houses at night) > > if i call the draw_house function once it will work properly ,but more than > one call,windows and doors disappear from some houses

Re: if the else short form

2010-09-30 Thread Andreas Waldenburger
On Thu, 30 Sep 2010 03:42:29 -0700 (PDT) "bruno.desthuilli...@gmail.com" wrote: > On 29 sep, 19:20, Seebs wrote: > > On 2010-09-29, Tracubik wrote: > > > button = gtk.Button(("False,", "True,")[fill==True]) > > > Oh, what a nasty idiom. > > > > Well, it's not very different from dict-based di

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Scott L. Burson
Ian Collins wrote: 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 we all have run time tools called unit tests, don't

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Seebs wrote: > And that's the magic of static typing: It is not a false positive to > warn you that "2L" is not of type int. We'll have to agree to disagree about that. The numerical value 2 can safely be represented as an int, so I would consider this a false positive. rg --

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Scott L. Burson
Pascal J. Bourguignon wrote: 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

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
Seebs writes: > On 2010-09-30, Paul Rubin wrote: >> int maximum(int a, int b); >> >> int foo() { >> int (*barf)() = maximum; >> return barf(3); >> } > >> This compiles fine for me. Where is the cast? > > On the first line of code inside foo(). Look again; there's no cast

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Paul Rubin
RG writes: > Yes, I know I could have used lint. But that misses the point. For any > static analyzer, because of the halting problem, I can construct a > program that either contains an error that the analyzer will not catch, > or for which the analyzer will produce a false positive. Can yo

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
RG writes: > One might hypothesize that the best of both worlds would be a dynamic > language with a static analyzer layered on top. Such a thing does not > exist. It makes an instructive exercise to try to figure out why. (For > the record, I don't know the answer, but I've learned a lot t

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
RG writes: > In article , > Seebs wrote: > >> On 2010-09-30, RG wrote: >> > You can't have it both ways. Either I am calling it incorrectly, in >> > which case I should get a compiler error, >> >> You get a warning if you ask for it. If you choose to run without all >> the type checking on

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
RG writes: > In article , > Keith Thompson wrote: >> RG writes: >> [...] >> > You can't have it both ways. Either I am calling it incorrectly, in >> > which case I should get a compiler error, or I am calling it correctly, >> > and I should get the right answer. That I got neither does in f

Re: Re: Problems with wsgi Python3

2010-09-30 Thread hidura
Sorry, for the last mail, here it's what you asked: {'CONTENT_LENGTH': '61', [Thu Sep 30 13:35:07 2010] [error] 'CONTENT_TYPE': [Thu Sep 30 13:35:07 2010] [error] 'multipart/form-data; boundary=---8905735096173894531259794847', [Thu Sep 30 13:35:07 2010] [error] 'DOCUME

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
TheFlyingDutchman writes: >> >> > "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. " >> >> > Dynamic typed languages like Python fail in this case on "Never blows >> > up". >> >> How do you define "Never blows up"? > >

Re: namespace hacking question

2010-09-30 Thread Arnaud Delobelle
MRAB writes: > On 30/09/2010 18:07, kj wrote: >> >> >> >> This is a recurrent situation: I want to initialize a whole bunch >> of local variables in a uniform way, but after initialization, I >> need to do different things with the various variables. >> >> What I end up doing is using a dict: >>

C API: Getting PyObject by name

2010-09-30 Thread pbienst
Hi, I'm embedding Python in a C app. Say I do the following: PyRun_SimpleString("a = 1") Is there then a way to get access to the PyObject corresponding to a, only making use in C of the fact that it's called "a"? I've searched through the API docs, but I couldn't really find what I was look

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > In article , > Seebs wrote: >> And that's the magic of static typing: It is not a false positive to >> warn you that "2L" is not of type int. > We'll have to agree to disagree about that. No, we won't. It's the *definition* of static typing. Static typing is there

  1   2   >