Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 11:16 pm, alex23 wrote: > I think this is the main issue we disagree on. I'm happier for Python > to remain lightweight where such features can be easily added on > demand through external libraries. I see no reason why a library > couldn't be as "well-engineered" a solution as an exte

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
Bruno Desthuilliers writes: > > Zope is about 375 KLOC[1], > How many LOCS would it require if it was written in ADA ? No idea. Ada is a lot more verbose than Python, but I'm baffled at what the heck Zope is actually doing with all that code. > > Zope also has 275 open bugs, 6 of which are crit

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 4:56 pm, Paul Rubin wrote: > Does the metaclass prevent reaching into the __dict__ in an instance? Yes, if you specify that '__dict__' is one of the private attributes. > Also, attribute protection is just a tiny aspect.  The high assurance > community re

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 4:55 pm, "Russ P." wrote: > Looks interesting. If it can somehow be integrated into the language > as full-fledged feature, then I'd say it has potential. As I said > before, I am not looking for a hack or a quick fix. I am interested in > well-engineered data hiding that is fully suppo

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
James Mills writes: > > "Today, Boeing uses about 500,000 lines of Ada to fly its commercial > > 747 400 in subsystem components, critical certification, and human > > safety features. Two of the three largest systems on the 747, or 43 > > percent of the executable bytes, are written in Ada. The s

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 11:03 pm, James Mills wrote: > Then -don't- use python. Use some other boring > language. (!...@#$!@#) > > --JamesMills You're emailing me again. Please don't do that. It's bad enough to get death threats in a newsgroup -- I don't need them in my inbox too. Thanks. -- http://mail.pyth

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 10:56 pm, Paul Rubin wrote: > Also, attribute protection is just a tiny aspect.  The high assurance > community really wants as much static verification as it can possibly > get.  Python doesn't really lend itself to that. Which is why I was hoping that P

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 4:55 PM, Russ P. wrote: > On Jan 20, 10:24 pm, alex23 wrote: >> This is pretty much what I had in mind when I said before that I >> believed such concerns could be addressed externally of the >> interpreter. Thankfully I thought to check Activestate before knocking >> up m

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
alex23 writes: > Okay, let me try a less snippy approach. How do you feel about > metaclass techniques such as this one by Carl Banks? > > http://code.activestate.com/recipes/573442/ Does the metaclass prevent reaching into the __dict__ in an instance? Also, attribute protection is just a tiny

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 10:24 pm, alex23 wrote: > On Jan 21, 3:20 pm, "Russ P." wrote: > > > But I doubt it will ever come to pass, because it is clear that much > > of the Python community has no clue about what is required for large- > > scale, safety-critical software engineering. > > Okay, let me try a le

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 4:49 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Today, Boeing uses about 500,000 lines of Ada to fly its commercial > 747 400 in subsystem components, critical certification, and human > safety features. Two of the three largest systems on the 747, or 43 > per

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
James Mills writes: > Who's to say that Python is not just as suitable > for the systems on-board a Boeing-747 then C++ ? "Today, Boeing uses about 500,000 lines of Ada to fly its commercial 747 400 in subsystem components, critical certification, and human safety features. Two of the three large

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 4:32 PM, Russ P. wrote: > But you did make some rather outlandish statements. I had written > this: > >> I suggest you call Boeing and tell them that encapsulation is more >> trouble than it's worth for their 787 flight software. But please >> don't do it if you ever wish t

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 10:18 pm, James Mills wrote: > I never did say that python -is- suitable for > all applications or that all languages are suitable > for all purposes. But you did make some rather outlandish statements. I had written this: > I suggest you call Boeing and tell them that encapsulation

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 3:20 pm, "Russ P." wrote: > But I doubt it will ever come to pass, because it is clear that much > of the Python community has no clue about what is required for large- > scale, safety-critical software engineering. Okay, let me try a less snippy approach. How do you feel about metacla

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 10:02 pm, alex23 wrote: > Can I comprehend that you don't even have an immediate need and are > instead actively engaging in online onanism? Absolutely. So anyone thinking beyond an "immediate need" is "engaging in online onanism"? Let's see. How long ago did the Python community sta

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 10:03 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Rhodri James" writes: >> You asked a question about CPUs with atomic update, strongly implying >> there were none. All I did was supply a counter-example, > > Well, more specifically, atomic update without loc

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 4:08 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Programming languages -do not- bare meaning to such systems nor have > an impact on their suitability or unsuitability" (I presume you mean > "bear" not "bare") is a far stronger and stupider statement than one >

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
James Mills writes: > >> Actually - in case you are perfectly unaware - programming > >> languages -do not- bare meaning to such systems nor have > >> an impact on their suitability or unsuitability. > > > > Er, who do you think you are trying to fool, saying things like that? > > Maybe just yours

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
"Rhodri James" writes: > You asked a question about CPUs with atomic update, strongly implying > there were none. All I did was supply a counter-example, Well, more specifically, atomic update without locking, but I counted the LOCK prefix as locking while other people didn't, and that caused so

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 3:20 pm, "Russ P." wrote: [...more invective and avoiding of questions snipped...] > Let me explain, moron. I don't need enforced data hiding for the > prototype I am working on now, because it's only a prototype that will > be converted into another more suitable language for the end

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:51 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > James Mills writes: >> Actually - in case you are perfectly unaware - programming >> languages -do not- bare meaning to such systems nor have >> an impact on their suitability or unsuitability. > > Er, who do you

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:47 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > James Mills writes: >> I guarantee that this is not the case, only that those that >> actually -do- use python for large scale projects or even mission >> critical or safety critical systems > > Do they exist? h

Re: Problem with 3.0 Install on Windows

2009-01-20 Thread John Machin
On Jan 21, 3:33 pm, Saul Spatz wrote: > I'm running python 2.5.x on Windows XP, and I installed 3.0, just to get > familiar with it.  I have a directory with all my python projects in my > PYTHONPATH variable.  When I try to run python 3.0, it detects a syntax > error (a print statement) in the fi

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
On Wed, 21 Jan 2009 05:37:44 -, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "Rhodri James" writes: In that case I'd second the suggestion of taking a long, hard look at the Linux core locking and synchronisation primatives. Do you understand what the issue is, about CPython's re

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
James Mills writes: > Actually - in case you are perfectly unaware - programming > languages -do not- bare meaning to such systems nor have > an impact on their suitability or unsuitability. Er, who do you think you are trying to fool, saying things like that? Maybe just yourself. > Have you eve

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
James Mills writes: > I guarantee that this is not the case, only that those that > actually -do- use python for large scale projects or even mission > critical or safety critical systems Do they exist? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write a simple shell loop in python?

2009-01-20 Thread Ben Finney
Dietrich Bollmann writes: > I am trying to write a simple shell loop in Python. You should investigate the ‘cmd’ module in the standard library http://docs.python.org/library/cmd.html>. > My simple approach works fine - but the first output line after > entering something is always indented by

Re: reading file to list

2009-01-20 Thread Rhodri James
On Wed, 21 Jan 2009 04:35:22 -, Xah Lee wrote: Xah Lee wrote: Similarly, if you can find any evidence, say by some code researcher's reports, that'd be great. At this point, i recall that i have read books on such report. You might try to do research on such books and read up. Given that

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Patrick Steiger
2009/1/20 Paul Rubin <"http://phr.cx"@nospam.invalid> > Luis Zarrabeitia writes: > > No wonder you can't get Bruno's point. For the second, static checks > > to prevent accidents, you have pylint. For the first, not only you > > are using the wrong tool, but you are barking at python for not > >

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:26 PM, Russ P. wrote: > I die? That sounds like a threat. I should report you for that, loser. > Are you going to stalk me now, loser? It's an expression you fool. > Oh, and does your software engineering professor agree with you that > Python is perfectly suitable for

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:20 PM, Russ P. wrote: (...) > Let me explain, moron. I don't need enforced data hiding for the > prototype I am working on now, because it's only a prototype that will > be converted into another more suitable language for the end product. > I am just interested in the i

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
"Rhodri James" writes: > I tend to live in single-core worlds, so "inc" on its lonesome works > just fine. In a single core world we wouldn't be having these endless angsty conversations about eliminating the GIL. > > That has already been tried, and found to be unacceptably slow for the > > pur

Re: python for flash drives

2009-01-20 Thread Ben Finney
Thomas Lord writes: > try portable python. it's free! You say it's free, but I'm unable to find the license terms easily on the web site. Which free software license does the recipient have in the work? -- \ “There's a certain part of the contented majority who love | `\

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 6:29 PM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Rhodri James" writes: >> > What cpu's do you know of that can atomically increment and decrement >> > integers without locking? >> >> x86 (and pretty much any 8080 derivative, come to think of it). > > It would

Re: How to write a simple shell loop in python?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:12 PM, Saul Spatz wrote: > Strange. I don't have an explanation, but experiment shows that if you > change print "$ ", to print "$ " (that is, leave out the comma) then the > leading blank is not printed. This behavior doesn't depend on the "print > input" statement's b

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
On Wed, 21 Jan 2009 02:29:01 -, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "Rhodri James" writes: > What cpu's do you know of that can atomically increment and decrement > integers without locking? x86 (and pretty much any 8080 derivative, come to think of it). It would not ha

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 9:07 pm, James Mills wrote: > On Wed, Jan 21, 2009 at 2:50 PM, Russ P. wrote: > >> My mistake for using "trivial" instead, I didn't realise it would trip > >> up your pedantry. > > > Your mistake for being a moron. But it seems to happen regularly, > > doesn't it. How much more of my t

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 9:00 pm, alex23 wrote: > On Jan 21, 2:50 pm, "Russ P." wrote: > > > If pylint can check for private access violations, then in principle > > someone could just add a run-time flag that would run pylint as a > > preliminary step to running python. Heck, I am *not* familiar with the > >

Re: How to write a simple shell loop in python?

2009-01-20 Thread Saul Spatz
Dietrich Bollmann wrote: Hi, I am trying to write a simple shell loop in Python. My simple approach works fine - but the first output line after entering something is always indented by one blank. Is there any logic explanation for this? How can I get rid of the blank? Is there a smarter

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 2:50 PM, Russ P. wrote: >> My mistake for using "trivial" instead, I didn't realise it would trip >> up your pedantry. > > Your mistake for being a moron. But it seems to happen regularly, > doesn't it. How much more of my time are you going to waste, loser? I'm sorry Russ

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 2:50 pm, "Russ P." wrote: > If pylint can check for private access violations, then in principle > someone could just add a run-time flag that would run pylint as a > preliminary step to running python. Heck, I am *not* familiar with the > internals of the interpreter, and even I could

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 8:26 pm, alex23 wrote: > On Jan 21, 1:18 pm, "Russ P." wrote: > > > Since when is no one is allowed to suggest a potential improvement to > > a product unless they are willing to implement it themselves? Imagine > > what the world would be like if such a rule applied to all products. >

Re: reading file to list

2009-01-20 Thread alex23
On Jan 21, 2:35 pm, Xah Lee wrote: > I, of course also based on my claims on personal > experience, however, the difference is that my claim is explicitly > made in the context of applying to the world. For example, my claim is > not about my experiences being such and such. My claim is about such

Re: Extracting real-domain-name (without sub-domains) from a given URL

2009-01-20 Thread Aahz
In article , S.Selvam Siva wrote: > > Actually i tried with domain specific logic.Having 200 TLD like >.com,co.in,co.uk and tried to extract the domain name. > But my boss want more reliable solution than this method,any way i >will try to find some alternative solution. http://www.dnspython.or

Re: reading file to list

2009-01-20 Thread Xah Lee
On Jan 20, 7:51 pm, Terry Reedy wrote: > Rhodri James wrote: > > Computer languages are not human languages, but computer language > > constructs do attempt to map onto human language constructs to > > provide some measure of comprehensibility. Where a construct like > > list comprehension maps v

Re: reading file to list

2009-01-20 Thread Xah Lee
Xah Lee wrote: > > consider code produced by corporations, as opposed to with respect to > > some academic or philsophical logical analysis. Looked in another way, > > consider if we can compile stat of all existing pyhton code used in > > real world, you'll find the above style is rarely used. Rh

Problem with 3.0 Install on Windows

2009-01-20 Thread Saul Spatz
I'm running python 2.5.x on Windows XP, and I installed 3.0, just to get familiar with it. I have a directory with all my python projects in my PYTHONPATH variable. When I try to run python 3.0, it detects a syntax error (a print statement) in the first file in this directory, and crashes. I

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 9:11 AM, Russ P. wrote: > Rather than waste more time replying to your post, Let me just refer > you to an excellent post that you may have missed earlier in this > thread by Mr. D'Aprano: > > http://groups.google.com/group/comp.lang.python/msg/d684d43b64a6e35a I'll finish

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 1:18 pm, "Russ P." wrote: > Since when is no one is allowed to suggest a potential improvement to > a product unless they are willing to implement it themselves? Imagine > what the world would be like if such a rule applied to all products. It wasn't the suggestion so much as the claim

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Terry Reedy
Delaney, Timothy (Tim) wrote: Terry Reedy wrote: The compiled code differs. I *strongly* doubt that. Properties are designed to be transparent to user code that access atrributes through the usual dotted name notation precisely so that class code can be changed from x = ob to x = proper

How to write a simple shell loop in python?

2009-01-20 Thread Dietrich Bollmann
Hi, I am trying to write a simple shell loop in Python. My simple approach works fine - but the first output line after entering something is always indented by one blank. Is there any logic explanation for this? How can I get rid of the blank? Is there a smarter way to write a simple shell

ossaudiodev problem: sawtooth noise

2009-01-20 Thread Peter Pearson
The following code uses ossaudiodev to read 1000 values from my sound card at a rate of 12,000 samples per second: *** begin code *** import ossaudiodev as o import struct d = o.open( "r" ) _, _, _ = d.setparameters( o.AFMT_S16_LE, 1, # channels

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
Rather than waste more time replying to your post, Let me just refer you to an excellent post that you may have missed earlier in this thread by Mr. D'Aprano: http://groups.google.com/group/comp.lang.python/msg/d684d43b64a6e35a -- http://mail.python.org/mailman/listinfo/python-list

python for flash drives

2009-01-20 Thread Thomas Lord
try portable python. it's free! http://www.portablepython.com/ -- http://mail.python.org/mailman/listinfo/python-list

RE: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Delaney, Timothy (Tim)
Terry Reedy wrote: >> The compiled code differs. > > I *strongly* doubt that. Properties are designed to be transparent to > user code that access atrributes through the usual dotted name > notation precisely so that class code can be changed from >x = ob > to >x = property(get_x, set_x,

Re: reading file to list

2009-01-20 Thread Terry Reedy
Rhodri James wrote: Computer languages are not human languages, but computer language constructs do attempt to map onto human language constructs to provide some measure of comprehensibility. Where a construct like list comprehension maps very well onto idiomatic English, dismissing it as "ad h

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Terry Reedy
Duncan Booth wrote: Luis Zarrabeitia wrote: It boggles me when I see python code with properties that only set and get the attribute, or even worse, getters and setters for that purpose. In my university they teach the students to write properties for the attributes in C# ("never make a public

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 1:18 PM, Russ P. wrote: > Since when is no one is allowed to suggest a potential improvement to > a product unless they are willing to implement it themselves? Imagine > what the world would be like if such a rule applied to all products. Maybe nobody wants what you want ?

Re: Regular Expressions...

2009-01-20 Thread Aahz
In article , Ken D'Ambrosio wrote: > >Hi, all. As a recovering Perl guy, I have to admit I don't quite "get" >the re module. Refer to the following every time you want to use regexes in Python: 'Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now th

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 6:47 pm, alex23 wrote: > (And that's not even commenting on the whole "I have no skill in this > area and only second-hand knowledge that it's possible but it's > *obvious* to me that it's trivial and *someone else* should easily be > able to do the work for me!" nature of your post...

Re: How to print lambda result ?

2009-01-20 Thread Terry Reedy
Tino Wildenhain wrote: or in python <3.0: (num,"s"*(num >1)) works fine in 3.0 too >>> num=1 >>> (num,"s"*(num >1)) (1, '') >>> num=2 >>> (num,"s"*(num >1)) (2, 's') Of course, 0 events gets 's' also, so (num!=1) is the actual comparison needed. -- http://mail.python.org/mailman/listinfo/

Re: English-like Python

2009-01-20 Thread MRAB
Terry Reedy wrote: Joe Strout wrote: Aaron Brady wrote: I think it would be a good step if you could make some sensible interpretation of a typical statement without its parentheses. f "abc" 123 --> f( "abc", 123 ) How would you differentiate f 'abc' + 'def' as f('abc') + 'def' versus f('a

Re: How to print lambda result ?

2009-01-20 Thread Terry Reedy
Barak, Ron wrote: Thanks Tino: your solutions without the lambda work nicely. What I still don't understand is why the print does not execute the lambda and prints the result, instead of printing the lambda's object description. You did not call it. -- http://mail.python.org/mailman/listinfo/

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
Luis Zarrabeitia writes: > > Whaat? Assuming a program is perfect unless a failure is proven > > is not at all a sane approach to getting reliable software. It is > > the person claiming perfection who has to prove the absence of failure. > > No, no. I meant that if pylint works as its specific

Re: English-like Python

2009-01-20 Thread Terry Reedy
Joe Strout wrote: Aaron Brady wrote: I think it would be a good step if you could make some sensible interpretation of a typical statement without its parentheses. f "abc" 123 --> f( "abc", 123 ) How would you differentiate f 'abc' + 'def' as f('abc') + 'def' versus f('abc' + 'def') Such a

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread alex23
On Jan 21, 5:04 am, "Russ P." wrote: > If pylint can check access violations, then it seems to me that > someone (who is familiar with the internals of the Python interpreter) > should be able to integrate that feature into Python itself relatively > easily. If pylint performs the data access pro

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
"Russ P." writes: > [I realize that Ada is on life support, and I probably sound like a > neanderthal for bringing it up so much, but it actually has many > advanced features that were well ahead of their time -- and still are > to some extent.] I have the impression that there has been an uptick

Re: Overloading Methods

2009-01-20 Thread TheFlyingDutchman
> > class Foo(object): > def __init__(self, a, b=10, c=None): > > Whereas in Java or C++ this would require several overloads, it can be > succinctly expressed as a single method in Python. > Not that it's important to the discussion, but, while Java does not have the capability to give defau

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
"Rhodri James" writes: > > What cpu's do you know of that can atomically increment and decrement > > integers without locking? > > x86 (and pretty much any 8080 derivative, come to think of it). It would not have occurred to me that "lock inc" increments "without locking". I understand that's d

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 5:16 pm, Mark Wooding wrote: > "Russ P." writes: > > Rather than waste more time replying to your post, Let me just refer > > you to an excellent post that you may have missed earlier in this > > thread by Mr. D'Aprano: > > I've responded to that now. (Steven and I can't even agree on

Re: what's the point of rpython?

2009-01-20 Thread skip
Rhodri> Just do the locking properly and worry about optimisations Rhodri> later. The locking is already done properly (assuming we are discussing CPython's reference counting). Now is later. People are thinking about lots of optimizations, this is just one of them. -- Skip Montanaro -

Re: what's the point of rpython?

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 04:19:26 -, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: "Brendan Miller" writes: Maybe I'm missing something here but a lock free algorithm for reference counting seems pretty trivial. As long as you can atomically increment and decrement an integer without loc

Re: pep 8 constants

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 04:58:30 -, Ben Finney wrote: Unless someone's going to argue that “Variable Names” doesn't apply to constant names, even though Python doesn't make the distinction. Python doesn't make the distinction, which is precisely why making the distinction through CONVENTION

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Mark Wooding
"Russ P." writes: > Rather than waste more time replying to your post, Let me just refer > you to an excellent post that you may have missed earlier in this > thread by Mr. D'Aprano: I've responded to that now. (Steven and I can't even agree on a description for simple parts of Python semantics

Re: reading file to list

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 03:39:45 -, Xah Lee wrote: On Jan 19, 4:49 pm, "Rhodri James" wrote: On Sun, 18 Jan 2009 08:31:15 -, Xah Lee wrote: > On Jan 17, 10:25 am, Tino Wildenhain wrote: >> > [[int(x) for x in line.split()] for line in open("blob.txt")] > Nice (python code). > Few comm

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Mark Wooding
Steven D'Aprano writes: > The consequence of this dynamism is that the Python VM can't do many > optimizations at all, because *at any time* somebody might mess with the > implementation. But 90% of the time nobody does, so Python is needlessly > slow 90% of the time. Wouldn't it be nice if th

Re: Two questions about style and some simple math

2009-01-20 Thread Rhodri James
On Tue, 20 Jan 2009 02:11:24 -, Mensanator wrote: On Jan 19, 7:44 pm, "Rhodri James" wrote: Surely in any case you don't want an expression based on the difference, since that would give you the same chance of having the first attack no matter what the levels of courage actually were, whi

Re: English-like Python

2009-01-20 Thread afriere
On Jan 16, 12:02 pm, The Music Guy wrote: > Just out of curiousity, have there been any attempts to make a version > of Python that looks like actual English text? I mean, so much of Python > is already based on the English language that it seems like the next > natural step would be to make a pro

REMINDER: OSCON 2009: Call For Participation

2009-01-20 Thread Aahz
The O'Reilly Open Source Convention has opened up the Call For Participation -- deadline for proposals is Tuesday Feb 3. OSCON will be held July 20-24 in San Jose, California. For more information, see http://conferences.oreilly.com/oscon http://en.oreilly.com/oscon2009/public/cfp/57 -- Aahz (a.

Re: s=str(binary)

2009-01-20 Thread gert
b = environ['CONTENT_TYPE'].split('boundary=')[1] oops forgot, is indeed better solution :) -- http://mail.python.org/mailman/listinfo/python-list

Style of "raise" (was Re: message of Exception)

2009-01-20 Thread Aahz
In article , Terry Reedy wrote: >Steven Woody wrote: >> >> And, I expect that when I raise a MyError as >> raise MyError, "my message" > >In 2.x you may and in 3.0 you must write that as >raise MyError("my message") >Best to start looking forward ;-). Funny, when I suggested to MvL that he

Re: s=str(binary)

2009-01-20 Thread gert
On Jan 20, 9:41 pm, John Machin wrote: > On Jan 21, 5:31 am, gert wrote: > > > On Jan 20, 5:23 am, John Machin wrote: > > > > On Jan 20, 12:54 pm, gert wrote: > > > > > How do you convert s back to binary data in python 3 so I can put in a > > > > sqlite blob ? > > > > Is there a build in funct

Re: frequency analysis without numpy

2009-01-20 Thread sturlamolden
On Jan 20, 11:09 pm, debug wrote: > So far i've managed to put together a chunk of code but I'm not sure > its returning the right values, any ideas? Don't use the periodogram for frequency analysis; it is not a good estimate of the power spectrum. According to the Wiener-Khintchin theorem, the

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
Paul Rubin wrote: >Those links describe using the LOCK prefix, which as the name implies, >asserts a lock, so it is no longer "lockless reference counting". No, it doesn't assert a lock in the sense used in this thread. On modern Intel systems it's normally handle

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Mark Wooding
"Russ P." writes: > Actually, in addition to the enforcement of "private," you also need > the enforcement of "protected." Oh, heavens. If you want C++ or any of its progeny, you know where to find them. Besides, those languages have a horrific design mistake because they conflate the class sy

frequency analysis without numpy

2009-01-20 Thread debug
Hi- I've been using python now for about 2 months for plugin development within Maya (a commercial 3d application). I'm currently in the process of writing a sound analysis plugin for maya and have completed a good portion of it including the ability to retrieve the amplitude at certain intervals

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 20, 2:39 pm, Paul Rubin wrote: > Rhamphoryncus writes: > > "lock free" is largely meaningless.  What it really means is "we use > > small hardware locks rather than big software locks, thereby reducing > > (but not eliminating!) the contention". > > At least i

Re: English-like Python

2009-01-20 Thread Erik Max Francis
Joe Strout wrote: Aaron Brady wrote: I think it would be a good step if you could make some sensible interpretation of a typical statement without its parentheses. f "abc" 123 --> f( "abc", 123 ) It would be just the thing in a couple of situations... Such a language is possible -- take a

Re: English-like Python

2009-01-20 Thread MRAB
Joe Strout wrote: Aaron Brady wrote: Unambiguity and readability are two different things. (This should be a quasi-tangent, neither agreed, nor opposed, nor unrelated to what you said.) If you have f "abc" 123 it's unambiguous, but, if you have g f "abc" 123 "def" there's no sure way to d

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
Rhamphoryncus writes: > "lock free" is largely meaningless. What it really means is "we use > small hardware locks rather than big software locks, thereby reducing > (but not eliminating!) the contention". At least in the case of Haskell's "software transactional memory", reads are genuinely loc

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
"Brendan Miller" writes: > > http://www.boost.org/doc/libs/1_37_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety > > I think you are misreading that. It says that multiple assignments to > different copies of a share_ptr in different threads are fine. I'll respond to this later. > http://www.codema

Re: PyQt4 on Windows ?

2009-01-20 Thread Gerhard Häring
Linuxguy123 wrote: What does it take to get a PyQt4 application running on a Windows machine ? To run, installing Python + PyQt4 ;-) To create a binary wrapper, I use py2exe (I also tried cx_Freeze, both work the same). There's a gotcha with PyQt4 - snippet follows: setup( options = {"p

RE: English-like Python

2009-01-20 Thread Benjamin J. Racine
Doesn't ipython (the interactive shell) make this possible in some cases... not that's what you seem to be looking for exactly. Ben Racine -Original Message- From: python-list-bounces+bjracine=glosten@python.org [mailto:python-list-bounces+bjracine=glosten@python.org] On Behalf

Re: Python 3: exec arg 1

2009-01-20 Thread Rob Williscroft
Alan G Isaac wrote in news:myhdl.805$aw2@nwrddc02.gnilink.net in comp.lang.python: > On 1/18/2009 9:36 AM Alan G Isaac apparently wrote: >> I do not much care about the disappearance of ``execfile``. >> I was asking, why is it a **good thing** that >> ``exec`` does not accept a TextIOWrapper?

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 19, 9:00 pm, "Brendan Miller" wrote: > Maybe I'm missing something here but a lock free algorithm for > reference counting seems pretty trivial. As long as you can atomically > increment and decrement an integer without locking you are pretty much > done. "lock free" is largely meaningless

Re: python processes and Visual Studio

2009-01-20 Thread bill
On Jan 19, 9:24 am, bill wrote: > All, > > This may sound somewhat convoluted, but here goes: > > 1. I have a Python script that invokes builds in Visual Studio via the > command line interface - 'devenv' > 2. It works GREAT > 3. I have added a post_build event to a VS Solution that has but one >

Re: s=str(binary)

2009-01-20 Thread John Machin
On Jan 21, 5:31 am, gert wrote: > On Jan 20, 5:23 am, John Machin wrote: > > > On Jan 20, 12:54 pm, gert wrote: > > > > How do you convert s back to binary data in python 3 so I can put in a > > > sqlite blob ? > > > Is there a build in function or do I need to use binascii ? > > > byte(s) or bi

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 16, 5:37 pm, "Brendan Miller" wrote: > So I kind of wanted to ask this question on the pypy mailing list.. > but there's only a pypy-dev list, and I don't want to put noise on the > dev list. > > What's the point of RPython? By this, I don't mean "What is RPython"? > I get that. I mean, why

Re: Overloading Methods

2009-01-20 Thread Chris Rebert
(top-posting just for consistency) In that case, you might also be interested in: http://dirtsimple.org/2004/12/python-is-not-java.html Cheers, Chris On Tue, Jan 20, 2009 at 12:19 PM, K-Dawg wrote: > Thank you for the explanation. With my background in Java, I have to get > myself to think a l

  1   2   >