Re: "Strong typing vs. strong testing"

2010-09-30 Thread TheFlyingDutchman
On Sep 30, 10:37 pm, RG wrote: > In article <87tyl63cag@mail.geddis.org>, >  Don Geddis wrote: > > > > > > > Keith Thompson wrote on Thu, 30 Sep 2010: > > > RG writes: > > >> You're missing a lot of context.  I'm not trying to criticize C, just to > > >> refute a false claim that was made a

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. If someone > >         tries to call it incorrectly it is a compile error. > > I would agree that the third sentence is arguably wrong, simply > because

Re: discussion

2010-09-30 Thread Arnaud Delobelle
John Nagle writes: > On 9/30/2010 7:12 PM, Geo_subodh wrote: >> please send me the simple python code that uses input number greater >> than3 digits(>3 digits) and checks whether the number is palindrome >> or not. > > def ispalin(s) : > s = str(s) > n = len(s) / 2 > return(s[:n] ==

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Seebs wrote: > On 2010-09-30, RG wrote: > > That gives (what I would consider to be) false positives, e.g.: > > > [...@mighty:~]$ cat foo.c > > > void foo(long x) {} > > > int main() { foo(1); } > > [...@mighty:~]$ gcc -Wconversion foo.c > > foo.c: In function ???main???: > > fo

Re: "Strong typing vs. strong testing"

2010-09-30 Thread rustom
Some points that seem to be missed (or Ive missed them?) 1. A dichotomy is being made between 'static' languages like C and 'dynamic' languages like python/lisp. This dichotomy was valid 30 years ago, not today. In Haskell for example - static checking is stronger than in C/C++ -- its very hard

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article <87tyl63cag@mail.geddis.org>, Don Geddis wrote: > Keith Thompson wrote on Thu, 30 Sep 2010: > > RG writes: > >> You're missing a lot of context. I'm not trying to criticize C, just to > >> refute a false claim that was made about it. > > Can you cite the article that made this

Re: Re: Re: Re: Problems with wsgi Python3

2010-09-30 Thread hidura
Now, i' m sure that the system it's uploading the file but still it's give me empty the information. I am considerating 2 crazy solutions what i want to share with you for listen your opinions: 1) Consist in translate to Python2.5 the area what receives the request and execute the area what

Re: Re: Re: Problems with wsgi Python3

2010-09-30 Thread hidura
Ppl, thankyou Diez and Thomas for your answers i did it, but it present me a problem with the solution what you give me Thomas this is the code: ValueError: Invalid boundary in multipart form: '' On Sep 30, 2010 6:16pm, hid...@gmail.com wrote: I still receive nothing, here it's the code of the

Re: discussion

2010-09-30 Thread Paul Rubin
John Nagle writes: > def ispalin(s) : > s = str(s) > n = len(s) / 2 > return(s[:n] == s[::-1][:n]) def ispalin(s): return (s == "You betcha!") ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: discussion

2010-09-30 Thread John Nagle
On 9/30/2010 7:12 PM, Geo_subodh wrote: please send me the simple python code that uses input number greater than3 digits(>3 digits) and checks whether the number is palindrome or not. def ispalin(s) : s = str(s) n = len(s) / 2 return(s[:n] == s[::-1][:n]) Please use a message sub

Re: discussion

2010-09-30 Thread Chris Rebert
On Thu, Sep 30, 2010 at 7:12 PM, Geo_subodh wrote: > please send me the simple python code that uses input number greater > than3 digits(>3 digits) and  checks whether the number is palindrome > or not. Do your own homework; it's not like you're even paying us (not that we would have the moral tu

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-10-01, Don Geddis 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. I would agree that the third sentence is arguably

Re: discussion

2010-09-30 Thread Roy Smith
In article <31a08825-bb72-4e9f-8710-a39fe2bc9...@u31g2000pru.googlegroups.com>, Geo_subodh wrote: > please send me the simple python code that uses input number greater > than3 digits(>3 digits) and checks whether the number is palindrome > or not. What class is this for? -- http://mail.pyth

Re: Having problem with subclass

2010-09-30 Thread Bruce Pearson
Try: import A class Bclass(A.Aclass) ...rest of code On 1/10/2010 9:54 AM, tekion wrote: All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class

discussion

2010-09-30 Thread Geo_subodh
please send me the simple python code that uses input number greater than3 digits(>3 digits) and checks whether the number is palindrome or not. -- http://mail.python.org/mailman/listinfo/python-list

Re: Having problem with subclass

2010-09-30 Thread Tim Chase
On 09/30/10 20:54, tekion wrote: All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class Bclas(Aclass): NameError: name 'Aclass' is not defined Whe

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Don Geddis
Keith Thompson wrote on Thu, 30 Sep 2010: > RG writes: >> You're missing a lot of context. I'm not trying to criticize C, just to >> refute a false claim that was made about it. > Can you cite the article that made this false claim, and exactly what > the false claim was? http://groups.google.

Re: Having problem with subclass

2010-09-30 Thread Chris Rebert
On Thu, Sep 30, 2010 at 6:54 PM, tekion wrote: > All, > I have file name A.py with a class name Aclass. I have a file name > B.py with sub class of Aclass, like > import A > class Bclass(Aclass) > ...rest of code > When I test it, calling B.py, I am getting: > > class Bclas(Aclass): > NameError: n

Having problem with subclass

2010-09-30 Thread tekion
All, I have file name A.py with a class name Aclass. I have a file name B.py with sub class of Aclass, like import A class Bclass(Aclass) ...rest of code When I test it, calling B.py, I am getting: class Bclas(Aclass): NameError: name 'Aclass' is not defined When I move Bclass to A.py, it works.

Re: namespace hacking question

2010-09-30 Thread alex23
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', 'eggs'): >  

Re: Re: Problems with wsgi Python3

2010-09-30 Thread hidura
I still receive nothing, here it's the code of the form maybe there it's the problem: name="input" target="hidden-frm"> On Sep 30, 2010 4:55pm, "Diez B. Roggisch" wrote: Thomas Jollans tho...@jollybox.de> writes: > On Thursday 30 September 2010, it occurred to hid...@gmail.com to

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Vend
On 30 Set, 03:01, RG wrote: > 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: > > >> >> O

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Vend
On 30 Set, 01:47, RG wrote: > 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

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Ian Collins
On 10/ 1/10 10:27 AM, Seebs wrote: On 2010-09-30, Ian Collins wrote: Which is why agile practices such as TDD have an edge. If it compiles *and* passes all its tests, it must be right. So far as I know, that actually just means that the test suite is insufficient. :) Based on my experience

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > I don't want to quibble over terminology. May I suggest that, if you don't want to use words and terminology precisely, perhaps computer programming is not for you? > Whatever label you choose to > put on it ("false positive", "not being able to express some things >

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, RG wrote: > That gives (what I would consider to be) false positives, e.g.: > [...@mighty:~]$ cat foo.c > void foo(long x) {} > int main() { foo(1); } > [...@mighty:~]$ gcc -Wconversion foo.c > foo.c: In function ???main???: > foo.c:4: warning: passing argument 1 of ???foo??? wit

Re: gedit 'External Tools' plugin hashlib weirdness

2010-09-30 Thread Joel Hedlund
On Sep 30, 3:40 pm, Peter Otten <__pete...@web.de> wrote: > I'm surprised that /usr/lib/python2.4 doesn't appear in the traceback. That certainly would have been useful, wouldn't it? -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, Ian Collins wrote: > Which is why agile practices such as TDD have an edge. If it compiles > *and* passes all its tests, it must be right. So far as I know, that actually just means that the test suite is insufficient. :) Based on my experience thus far, anyway, I am pretty sur

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Paul Rubin
TheFlyingDutchman writes: > With Tiny C on my system, your code does not cause maximum to give an > incorrect value, or to blow up: > > int maximum(int a, int b) > { > printf("entering maximum %d %d\n",a,b); > if ( a > b ) > return a; > else > return b; > } What did printf show as "

Re: Pyflakes and IPython does not work for Emacs on Windows?

2010-09-30 Thread Dsrt Egle
On Sep 24, 4:53 pm, David Robinow wrote: > On Fri, Sep 24, 2010 at 4:59 PM,DsrtEgle wrote: > > ... > > I can't invoke IPython by Emacs on Windows, either. Looks ipyhon.el > > only works for Linux? > > There don't appear to be a lot of ipython.el users on Windows. > You may have better look on an e

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
RG writes: [...] > You're missing a lot of context. I'm not trying to criticize C, just to > refute a false claim that was made about it. Can you cite the article that made this false claim, and exactly what the false claim was? -- Keith Thompson (The_Other_Keith) ks...@mib.org

Re: Problems with wsgi Python3

2010-09-30 Thread Diez B. Roggisch
Thomas Jollans writes: > On Thursday 30 September 2010, it occurred to hid...@gmail.com to exclaim: >> What mean this >> -743346150198628700241600224--\r? > > it looks like a MIME boundary. In this context most likely from a > multipart/form-data transmission. yep, a

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Paul Rubin
RG writes: > I don't want to quibble over terminology. Whatever label you choose to > put on it ("false positive", "not being able to express some things > without special extra effort") I consider it a deficiency. The costs > are greater than the benefits. Reasonable people can (and obvious

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
Seebs writes: > On 2010-09-30, Keith Thompson wrote: >> Seebs writes: >>> On 2010-09-30, Paul Rubin wrote: int maximum(int a, int b); > int foo() { int (*barf)() = maximum; return barf(3); } > >> That first line declare barf as an object of type

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
Keith Thompson writes: > const double pi = 2.71828182845904523526; > > To a human reader, it's obviously either a mistake or deliberate > obfuscation, but I'm not sure I'd *want* my compiler to warn me > about it just because I named the object "pi" rather than "e". > (And if I called it "x",

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Paul Rubin
RG writes: > There are only two possibilities: either you have a finite-state > machine, or you have a Turning machine. (Well, OK, you could have a > pushdown automaton, but there are no programming languages that model a > PDA. The point is that the halting problem for general Turing machine

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
Ian Collins writes: > On 10/ 1/10 02:57 AM, Pascal Bourguignon wrote: >> 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

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Pascal J. Bourguignon
RG writes: >> The main example of a sensible program that can't be written in a >> non-complete language is an interpreter for a Turing-complete language. >> But presumably a high-assurance application should never contain such a >> thing, since the interpreted programs themselves then wouldn't ha

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Keith Thompson wrote: > RG writes: > > 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 defi

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Gene
On Sep 30, 3:45 pm, RG wrote: > In article <7xr5gbxfry@ruckus.brouhaha.com>, >  Paul Rubin wrote: > > > > > > > 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 tha

Re: Problems with wsgi Python3

2010-09-30 Thread Thomas Jollans
On Thursday 30 September 2010, it occurred to hid...@gmail.com to exclaim: > What mean this > -743346150198628700241600224--\r? it looks like a MIME boundary. In this context most likely from a multipart/form-data transmission. > > On Sep 30, 2010 2:38pm, hid...@gmai

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article , Seebs wrote: > 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 *defini

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article <0390e2b4-fa28-49b3-a867-39be6d668...@w19g2000yqb.googlegroups.com>, ImpalerCore wrote: > On Sep 29, 9:01 pm, RG wrote: > > > > > [...@mighty:~]$ cat foo.c > > #include > > > > int maximum(int a, int b) { return a > b ? a : b; } > > > > int main() { > >   long x = 8589934592; >

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Keith Thompson
RG writes: > 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

Re: "Strong typing vs. strong testing"

2010-09-30 Thread ImpalerCore
On Sep 29, 9:01 pm, RG wrote: > [...@mighty:~]$ cat foo.c > #include > > int maximum(int a, int b) { return a > b ? a : b; } > > int main() { >   long x = 8589934592; >   printf("Max of %ld and 1 is %d\n", x, maximum(x,1)); >   return 0;} > > [...@mighty:~]$ gcc -Wall foo.c > [...@mighty:~]$ .

Re: "Strong typing vs. strong testing"

2010-09-30 Thread RG
In article <7xr5gbxfry@ruckus.brouhaha.com>, Paul Rubin wrote: > 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

Re: Determine sockets in use by python

2010-09-30 Thread exarkun
On 07:32 pm, jmellan...@lbl.gov wrote: Thanks, I realized that even if I found out relevant info on the socket, I would probably need to use ctypes to provide a low level interface to select, as the socket wouldn't be a python socket object, unless there is some way to promote a c socket to a py

Re: Re: Re: Problems with wsgi Python3

2010-09-30 Thread hidura
What mean this -743346150198628700241600224--\r? On Sep 30, 2010 2:38pm, hid...@gmail.com wrote: 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] 'mult

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Ian Collins
On 10/ 1/10 08:21 AM, Seebs wrote: On 2010-09-30, Keith Thompson wrote: IMHO it's better to use prototypes consistently than to figure out the rules for interactions between prototyped vs. non-prototyped function declarations. Yes. It's clearly undefined behavior to call a function through

Re: Determine sockets in use by python

2010-09-30 Thread Jim Mellander
Thanks, I realized that even if I found out relevant info on the socket, I would probably need to use ctypes to provide a low level interface to select, as the socket wouldn't be a python socket object, unless there is some way to promote a c socket to a python socket object. Appreciate the info,

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Ian Collins
On 10/ 1/10 02:57 AM, Pascal Bourguignon wrote: 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 m

Re: "Strong typing vs. strong testing"

2010-09-30 Thread Seebs
On 2010-09-30, Keith Thompson wrote: > Seebs writes: >> On 2010-09-30, Paul Rubin wrote: >>> int maximum(int a, int b); >>> int foo() { >>> int (*barf)() = maximum; >>> return barf(3); >>> } > That first line declare barf as an object of type "pointer to > function retu

Re: C API: Getting PyObject by name

2010-09-30 Thread Thomas Jollans
On Thursday 30 September 2010, it occurred to pbienst to exclaim: > 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 calle

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

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

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

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

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

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

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

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

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

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

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

  1   2   >