Re: Beginner needs advice

2011-05-27 Thread Thorsten Kampe
* Thorsten Kampe (Sat, 28 May 2011 08:38:54 +0200) > My experience is: unless the code is especially written with Python3 > compatability [...] Oops, I meant "unless the code is specifically written with Python3 compatability in mind [...]" Thorsten -- http://mail.python.org/mailman/listinfo/py

Re: Beginner needs advice

2011-05-27 Thread Chris Angelico
On Sat, May 28, 2011 at 4:38 PM, Thorsten Kampe wrote: > The question is: if you want (or have) to run your code under Python3, > how likely is that it will run unmodified? My experience is: unless the > code is especially written with Python3 compatability or just a short > snippet, it's actually

Re: Beginner needs advice

2011-05-27 Thread Thorsten Kampe
* Thomas Rachel (Sat, 28 May 2011 07:06:53 +0200) > Am 27.05.2011 17:52 schrieb Steven D'Aprano: > > On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote: > >> 3.x is completely incompatible with 2.x (some call it a dialect, > >> but that is a lie). > > > > "Completely incompatible"? A "lie"? > >

Re: Beginner needs advice

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 15:40:53 -0500, harrismh777 wrote: > Steven D'Aprano wrote: >> Would you care to revise your claims? > > No. > > > You have erected a straw-man... once again. You keep using that term, but it is clear to me that you don't have the foggiest idea of what the straw-man fallac

Re: English Idiom in Unix: Directory Recursively

2011-05-27 Thread David Schwartz
On May 20, 12:00 am, Jonathan de Boyne Pollard wrote: > Indeed. And the algorithms that are employed to perform the operations > so described are recursive. Actually, they almost never are. Iterative algorithms are almost always used to avoid a stack explosion. However, the terminology is still

Re: Beginner needs advice

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 20:02:39 -0500, harrismh777 wrote: > But the true picture is that 3.x is (way better) and completely > incompatible with 2.x. Lying about this isn't helpful to anyone coming > on board with Python. Just tell them the truth... Take your own advice and stop accusing others of

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Carl Banks
On Friday, May 27, 2011 6:47:21 AM UTC-7, Roy Smith wrote: > In article <948l8n...@mid.individual.net>, > Gregory Ewing wrote: > > > John Bokma wrote: > > > > > A Perl programmer will call this line noise: > > > > > > double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)", > > >

Re: Python's super() considered super!

2011-05-27 Thread Thomas Rachel
Am 28.05.2011 01:57 schrieb sturlamolden: Yes. And opposite: CPython cannot know that builtin super() is not called, even if it does not see the name 'super'. I can easily make foo() alias super(). Another alternative would have been to make use of __xxx magic. If every class had an "automati

Re: Beginner needs advice

2011-05-27 Thread Thomas Rachel
Am 27.05.2011 17:52 schrieb Steven D'Aprano: On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote: 3.x is completely incompatible with 2.x (some call it a dialect, but that is a lie). "Completely incompatible"? A "lie"? Hard word, but it is true. Many things can and will fall on your feet

Re: bdist_wininst: install_script not run on uninstall

2011-05-27 Thread Mark Hammond
On 26/05/2011 6:00 PM, Wilbert Berendsen wrote: Op donderdag 26 mei 2011 schreef Mark: Wilbert wrote: can anybody find out why the install script is not run? Works for me in the pywin32 install script - maybe you should make the smallest possible example that doesn't work and post the entir

Re: GIL in alternative implementations

2011-05-27 Thread Daniel Kluev
> So I'd like to know: how do these other implementations handle concurrency > matters for their primitive types, and prevent them from getting corrupted > in multithreaded programs (if they do) ? I'm not only thinking about python > types, but also primitive containers and types used in .Net and J

Re: changing current dir and executing a shell script

2011-05-27 Thread suresh
On Friday, May 27, 2011 3:19:22 PM UTC-7, Albert Hopkins wrote: > On Fri, 2011-05-27 at 14:25 -0700, suresh wrote: > > Hi, > > I want to execute the following command line stuff from inside python. > > $cd directory > > $./executable > > > > I tried the following but I get errors > > import subpr

Re: Beginner needs advice

2011-05-27 Thread Dan Stromberg
On Fri, May 27, 2011 at 7:40 AM, harrismh777 wrote: > Colin J. Williams wrote: > >> It would be safer to stick with Python 2.7 initially and then consider >> the transition to 3.2 later. >> > > I must disagree with Colin's statement. If you are a complete beginner with > Python... then there is go

Re: Beginner needs advice

2011-05-27 Thread Ethan Furman
harrismh777 wrote: Chris Angelico wrote: To say that "most" 2.x code is incompatible with 3.x is to deny the 2to3 utility, all I'm saying is that 3.x is not compatible with 2.x code (completely not compatible) and you're ignoring the people who deliberately write code that can cross-execu

Re: Beginner needs advice

2011-05-27 Thread harrismh777
Chris Angelico wrote: To say that "most" 2.x code is incompatible with 3.x is to deny the 2to3 utility, Oh, yes absolutely. Please don't misunderstand... anyone... I'm not saying that code cannot be migrated... migration can usually occur between incompatible releases and and between langu

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 18:06, Steven D'Aprano wrote: > Why? The fault is not that super is a function, or that you monkey- > patched it, or that you used a private function to do that monkey- > patching. The fault was that you made a common, but silly, mistake when > reasoning about type(self) inside a class

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 23:49, Stefan Behnel wrote: > I think Sturla is referring to the "compile time" bit. CPython cannot know > that the builtin super() will be called at runtime, even if it sees a > "super()" function call. Yes. And opposite: CPython cannot know that builtin super() is not called, even i

Re: Python's super() considered super!

2011-05-27 Thread Ryan Kelly
On Fri, 2011-05-27 at 15:05 +, Duncan Booth wrote: > sturlamolden wrote: > > I really don't like the Python 2 syntax of super, as it violates > > the DRY principle: Why do I need to write super(type(self),self) > > when super() will do? Assuming that 'self' will always be named > > 'self' in m

Re: Beginner needs advice

2011-05-27 Thread Chris Angelico
On Sat, May 28, 2011 at 6:40 AM, harrismh777 wrote: > Most 2.x code *will not* run correctly in 3.x/  Most of the best > improvements and enhancements of 3.x will not back-port to below 2.7, and > almost none of them will back-port before 2.6 (class decorations, for > instance). What's with the "

Re: changing current dir and executing a shell script

2011-05-27 Thread Thorsten Kampe
* suresh (Fri, 27 May 2011 14:25:52 -0700 (PDT)) > I want to execute the following command line stuff from inside python. > $cd directory > $./executable > > I tried the following but I get errors > import subprocess > subprocess.check_call('cd dir_name;./executable') > > Due to filename path is

Re: changing current dir and executing a shell script

2011-05-27 Thread Albert Hopkins
On Fri, 2011-05-27 at 14:25 -0700, suresh wrote: > Hi, > I want to execute the following command line stuff from inside python. > $cd directory > $./executable > > I tried the following but I get errors > import subprocess > subprocess.check_call('cd dir_name;./executable') > > Due to filename p

Re: changing current dir and executing a shell script

2011-05-27 Thread Dan Stromberg
Each command will be run in a distinct subprocess. A CWD is typically local to a given subprocess. So after the first command/subprocess exits, your cd's change is no longer there. Try doing it in one command, with the two original commands separated by a semicolon. On Fri, May 27, 2011 at 2:25

Re: Python's super() considered super!

2011-05-27 Thread Ethan Furman
I suspect the larger issue is that Multiple Inheritance is complex, but folks don't appreciate that. Ask anyone about meta-classes and their eyes bug-out, but MI? Simple! NOT. On the other hand, perhaps the docs should declare that the built-in objects are not designed for MI, so that that,

Re: Python's super() considered super!

2011-05-27 Thread Stefan Behnel
Steven D'Aprano, 27.05.2011 18:06: On Fri, 27 May 2011 08:31:40 -0700, sturlamolden wrote: On 27 Mai, 17:05, Duncan Booth wrote: Oops. There's a reason why Python 2 requires you to be explicit about the class; you simply cannot work it out automatically at run time. Python 3 fixes this by wo

changing current dir and executing a shell script

2011-05-27 Thread suresh
Hi, I want to execute the following command line stuff from inside python. $cd directory $./executable I tried the following but I get errors import subprocess subprocess.check_call('cd dir_name;./executable') Due to filename path issues, I cannot try this version. subprocess.check_call('./dir_n

Re: Beginner needs advice

2011-05-27 Thread Ethan Furman
Lew Schwartz wrote: So, if I read between the lines correctly, you recommend Python 3? Does the windows version install with a development environment? Dabo, last I checked, uses wxPython, which uses wxWidgets (sp?), which is not yet ported to Python 3. So if you got that route you'll need to

Re: Python's super() considered super!

2011-05-27 Thread John Nagle
On 5/27/2011 11:46 AM, Chris Angelico wrote: On Sat, May 28, 2011 at 4:31 AM, Ian Kelly wrote: It seems to me that the example of combining built-in dictionary classes is naively optimistic. So... Can anyone offer a non-trivial example of multiple inheritance that *doesn't* have pitfalls? F

Re: Beginner needs advice

2011-05-27 Thread harrismh777
Steven D'Aprano wrote: Would you care to revise your claims? No. You have erected a straw-man... once again. Most 2.x code *will not* run correctly in 3.x/ Most of the best improvements and enhancements of 3.x will not back-port to below 2.7, and almost none of them will back-port before

sys.tracebacklimit not working in Python 3.2?

2011-05-27 Thread Thorsten Kampe
Hi, > type test.py import sys sys.tracebacklimit = 0 import doesnotexist > python test.py ImportError: No module named doesnotexist > python3 test.py Traceback (most recent call last): File "test.py", line 4, in import doesnotexist ImportError: No module named doesnotexist The 3.2 docum

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Karim
On 05/27/2011 03:47 PM, Roy Smith wrote: In article<948l8nf33...@mid.individual.net>, Gregory Ewing wrote: John Bokma wrote: A Perl programmer will call this line noise: double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)", re.IGNORECASE) One of the tru

Re: Python 3.2 bug? Reading the last line of a file

2011-05-27 Thread tkp...@hotmail.com
This is exactly what I want to do - I can then pick up various elements of the list and turn them into floats, ints, etc. I have not ever used decode, and will look it up in the docs to better understand it. I can't thank everyone enough for the generous serving of help and guidance - I certainly w

Re: Python's super() considered super!

2011-05-27 Thread Chris Angelico
On Sat, May 28, 2011 at 4:31 AM, Ian Kelly wrote: > It seems to me that the example of combining built-in dictionary > classes is naively optimistic. So... Can anyone offer a non-trivial example of multiple inheritance that *doesn't* have pitfalls? From what I've seen, MI always seems to require

Re: Puzzled by list-appending behavior

2011-05-27 Thread Ethan Furman
Prasad, Ramit wrote: I have to say, I do like Python's lack of keywords for these things I thought True/False were among the list of keywords in Python 3.x ? Or are those the only keywords? http://docs.python.org/py3k/reference/lexical_analysis.html#keywords False class finally

[ANN] Python 2.5.6 released

2011-05-27 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.6. There were no changes since the release candidate. This is a source-only release that only includes security fixes. The last full bug-fix release of Python 2.5 was Python 2.5.4. Us

Re: Python's super() considered super!

2011-05-27 Thread Chris Angelico
On Sat, May 28, 2011 at 4:10 AM, Prasad, Ramit wrote: >>>We also, though, need *real* URLs. Blind URLs through obfuscation >>>services have their uses, but surely not in a forum like this. The real >>>URL is http://news.ycombinator.com/item?id=2588262>. > > I remember reading a news article where

Re: Python's super() considered super!

2011-05-27 Thread Ian Kelly
On Thu, May 26, 2011 at 10:31 AM, Raymond Hettinger wrote: > I just posted a tutorial and how-to guide for making effective use of > super(). I posted this already on the HackerNews thread but it seems to have largely gone unnoticed, so I'm reposting it here. It seems to me that the example of c

RE: The worth of comments

2011-05-27 Thread Prasad, Ramit
>(Did I *really* write that code? It has my name on it.) Damn those ninja programmers who stole your name and coded something! Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 This communication

Re: The worth of comments

2011-05-27 Thread Patty
- Original Message - From: "Ethan Furman" To: Sent: Friday, May 27, 2011 11:14 AM Subject: Re: The worth of comments Miki Tebeka wrote: https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;) +1 That was hilarious. ~Ethan~ -- http://mail.python.org/mailman/listinfo

RE: Python's super() considered super!

2011-05-27 Thread Prasad, Ramit
>>We also, though, need *real* URLs. Blind URLs through obfuscation >>services have their uses, but surely not in a forum like this. The real >>URL is http://news.ycombinator.com/item?id=2588262>. I remember reading a news article where a man was arrested (or was it fired) for pornography because

Re: The worth of comments

2011-05-27 Thread Ethan Furman
Miki Tebeka wrote: https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;) +1 That was hilarious. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

RE: Puzzled by list-appending behavior

2011-05-27 Thread Prasad, Ramit
>I have to say, I do like Python's lack of keywords for these things I thought True/False were among the list of keywords in Python 3.x ? Or are those the only keywords? Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone

Re: Python's super() considered super!

2011-05-27 Thread Eric Snow
On Fri, May 27, 2011 at 4:37 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Fri, 27 May 2011 18:49:52 +1000, Ben Finney wrote: > > > Raymond Hettinger writes: > > > >> Hope you enjoyed the post. > > > > I certainly did. > > > > But I'm not better enlightened on why ‘super

Re: The worth of comments

2011-05-27 Thread Grant Edwards
On 2011-05-27, Irmen de Jong wrote: > On 27-05-11 15:54, Grant Edwards wrote: >> On 2011-05-27, Ben Finney wrote: >>> Richard Parker writes: >>> On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: > My experience is that comments in Python are of relatively low >

Re: The worth of comments

2011-05-27 Thread Grant Edwards
On 2011-05-27, Miki Tebeka wrote: > https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;) I just realized that Usenet is sort of like radio. After hearing/reading somebody for years, I don't seem to have a detailed image of them in my head, but when I finally do see a picture of

Re: Python's super() considered super!

2011-05-27 Thread Ethan Furman
Duncan Booth wrote: Steven D'Aprano wrote: I was thrilled to learn a new trick, popping keyword arguments before calling super, and wondered why I hadn't thought of that myself. How on earth did I fail to realise that a kwarg dict was mutable and therefore you can remove keyword args, or inj

Re: The worth of comments

2011-05-27 Thread Irmen de Jong
On 27-05-11 15:54, Grant Edwards wrote: On 2011-05-27, Ben Finney wrote: Richard Parker writes: On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: My experience is that comments in Python are of relatively low usefulness. (For avoidance of doubt: not *zero* usefulness, mere

Re: bug in str.startswith() and str.endswith()

2011-05-27 Thread Ethan Furman
Ethan Furman wrote: Any reason this is not a bug? Looks like someone else beat me to filing: http://bugs.python.org/issue11828 Looks like they fixed it as well. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Ethan Furman
Thorsten Kampe wrote: * Steven D'Aprano (27 May 2011 03:07:30 GMT) Okay, I've stayed silent while people criticize me long enough. What exactly did I say that was impolite? Nothing. John threw down a distinct challenge: if Python is really so much better than Python [sic] readabil

Re: Python-list Digest, Vol 92, Issue 232

2011-05-27 Thread Richard Parker
Sometimes >> I'll drop in suggestions to future maintainers like, "consider >> refactoring with with perform_frobnitz_action()" > > Usually, I address future-me with comments like that (on the > assumption that there's nobody in the world sadistic enough to want to > maintain my code). But I neve

Re: [Python-ideas] Adding 'bytes' as alias for 'latin_1' codec.

2011-05-27 Thread MRAB
On 27/05/2011 10:27, Nick Coghlan wrote: On Fri, May 27, 2011 at 6:46 PM, Stephen J. Turnbull wrote: > What method is invoked to convert the numbers to text? What encoding > is used to convert those numbers to text? How does this operation > avoid also converting the *bytes* object to

Re: Python's super() considered super!

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 08:31:40 -0700, sturlamolden wrote: > On 27 Mai, 17:05, Duncan Booth wrote: > >> Oops. There's a reason why Python 2 requires you to be explicit about >> the class; you simply cannot work it out automatically at run time. >> Python 3 fixes this by working it out at compile ti

Re: Puzzled by list-appending behavior

2011-05-27 Thread MRAB
On 27/05/2011 07:34, Tim Roberts wrote: MRAB wrote: I'd just like to point out that it's a convention, not a rigid rule. Reminds me of the catch-phrase from the first Pirates of the Caribbean movie: "It's more of a guideline than a rule." Much like the Zen of Python. -- http://mail.python.

Re: The worth of comments

2011-05-27 Thread Miki Tebeka
https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner needs advice

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote: > 3.x is completely incompatible with 2.x (some call it a dialect, > but that is a lie). "Completely incompatible"? A "lie"? import math import random my_list = [3, 5, 7, 9] n = random.choice(my_list) if n%3: func = math.sin else:

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 17:05, Duncan Booth wrote: > Oops. There's a reason why Python 2 requires you to be explicit about > the class; you simply cannot work it out automatically at run time. > Python 3 fixes this by working it out at compile time, but for Python 2 > there is no way around it. Then it shoul

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 17:05, Duncan Booth wrote: > >>> class C(B): pass > >>> C().foo() > > ... infinite recursion follows ... That's true :( -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 27 Mai, 16:27, sturlamolden wrote: > Assuming that 'self' will always be named > 'self' in my code, I tend to patch __builtins__.super like this: > > import sys > def super(): >     self = sys._getframe().f_back.f_locals['self'] >     return __builtins__.super(type(self),self) A monkey-patch

Re: Python's super() considered super!

2011-05-27 Thread harrismh777
Steven D'Aprano wrote: Python causes trouble by letting the users get at the internals, but > things like this make it worthwhile. Only if by "worthwhile" you mean "buggy as hell". I *don't* believe this... the king of metaphors and bogus analogies has come up with 'buggy as hell' !!?

Re: Python's super() considered super!

2011-05-27 Thread Duncan Booth
sturlamolden wrote: > On 26 Mai, 18:31, Raymond Hettinger wrote: >> I just posted a tutorial and how-to guide for making effective use of >> super(). >> >> One of the reviewers, David Beazley, said, "Wow,  that's really >> great!    I see this becoming the definitive post on the subject" >> >> T

Re: Python's super() considered super!

2011-05-27 Thread Michele Simionato
The fact that even experienced programmers fail to see that super(type(self),self) in Python 2 is NOT equivalent to super() in Python 3 is telling something. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's super() considered super!

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 10:33:20 -0400, Mel wrote: > sturlamolden wrote: > >> I really don't like the Python 2 syntax of super, as it violates the >> DRY principle: Why do I need to write super(type(self),self) when >> super() will do? Assuming that 'self' will always be named 'self' in my >> code, I

Re: Beginner needs advice

2011-05-27 Thread harrismh777
Colin J. Williams wrote: It would be safer to stick with Python 2.7 initially and then consider the transition to 3.2 later. I must disagree with Colin's statement. If you are a complete beginner with Python... then there is going to a learning curve for you... and that curve should be 3.2---

Re: Abandoning Python

2011-05-27 Thread harrismh777
Paul Rubin wrote: Haskell probably has the most vibrant development community at the moment but its learning curve is quite steep, and it has various shortcomings some of which are being worked on but others of which may be insurmountable. Yes. You might want to lurk on: http://lambda-the-u

Re: Python's super() considered super!

2011-05-27 Thread Mel
sturlamolden wrote: > I really don't like the Python 2 syntax of super, as it violates > the DRY principle: Why do I need to write super(type(self),self) > when super() will do? Assuming that 'self' will always be named > 'self' in my code, I tend to patch __builtins__.super like this: > > import

Re: English Idiom in Unix: Directory Recursively

2011-05-27 Thread harrismh777
Steven D'Aprano wrote: You really do need to know whether the car you drive uses leaded or unleaded. Actually, you need to know whether your car can burn 85 gas (at about 60 cents /gallon cheaper... and, whether 85 gas will have enough energy to move the car without using 35% more fuel...

Re: Python's super() considered super!

2011-05-27 Thread sturlamolden
On 26 Mai, 18:31, Raymond Hettinger wrote: > I just posted a tutorial and how-to guide for making effective use of > super(). > > One of the reviewers, David Beazley, said, "Wow,  that's really > great!    I see this becoming the definitive post on the subject" > > The direct link is: > >  http://

Re: The worth of comments

2011-05-27 Thread Grant Edwards
On 2011-05-27, Ben Finney wrote: > Richard Parker writes: > >> On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: >> >> > My experience is that comments in Python are of relatively low >> > usefulness. (For avoidance of doubt: not *zero* usefulness, merely >> > low.) I've seen pl

Re: bug in str.startswith() and str.endswith()

2011-05-27 Thread Roy Smith
In article , Stefan Behnel wrote: > Roy Smith, 27.05.2011 03:13: > > Ethan Furman wrote: > > > >> --> 'this is a test'.startswith('this') > >> True > >> --> 'this is a test'.startswith('this', None, None) > >> Traceback (most recent call last): > >> File "", line 1, in > >> TypeError: sl

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Roy Smith
In article <948l8nf33...@mid.individual.net>, Gregory Ewing wrote: > John Bokma wrote: > > > A Perl programmer will call this line noise: > > > > double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)", > > re.IGNORECASE) One of the truly awesome things about th

Re: The worth of comments

2011-05-27 Thread Roy Smith
In article , Chris Angelico wrote: > (Did I *really* write that code? It has my name on it.) Most version control systems have an annotate command which lets you see who wrote a given line of code. Some of them are even honest enough to call the command "blame" instead of "annotate" :-)

Re: The worth of comments

2011-05-27 Thread D'Arcy J.M. Cain
On Fri, 27 May 2011 00:02:23 -0700 Tim Roberts wrote: > Ruby has a lot of followers, and I am trying to get excited about it, but > it has succumbed to the same special-characters-as-syntax disease that > killed Perl. Much Ruby code is just unreadable. What? The recent Perl flame war wasn't eno

Re: bug in str.startswith() and str.endswith()

2011-05-27 Thread Mel
Terry Reedy wrote: > To me, that says pretty clearly that start and end have to be > 'positions', ie, ints or other index types. So I would say that the > error message is a bug. I see so reason why one would want to use None > rather that 0 for start or None rather than nothing for end. If you'r

Re: Python's super() considered super!

2011-05-27 Thread Duncan Booth
Steven D'Aprano wrote: > I was thrilled to learn a new trick, popping keyword arguments before > calling super, and wondered why I hadn't thought of that myself. How on > earth did I fail to realise that a kwarg dict was mutable and therefore > you can remove keyword args, or inject new ones i

Re: Python's super() considered super!

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 18:49:52 +1000, Ben Finney wrote: > Raymond Hettinger writes: > >> Hope you enjoyed the post. > > I certainly did. > > But I'm not better enlightened on why ‘super’ is a good thing. Perhaps Raymond assumed that by now everybody knows that multiple inheritance in Python t

Re: bug in str.startswith() and str.endswith()

2011-05-27 Thread Duncan Booth
Carl Banks wrote: > The end parameter looks pretty useless for > .startswith() and is probably only present for consistency with other > string search methods like .index(). No, the end parameter could be useful if the slice ends up shorter than the prefix string: >>> 'abcd'.startswith('abc',

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Steven D'Aprano
On Fri, 27 May 2011 10:10:55 +0200, Thorsten Kampe wrote: > * Steven D'Aprano (27 May 2011 03:07:30 GMT) [...] >> If I got it wrong about John, oh well, I said it was a guess, and >> trying to get inside someone else's head is always a chancy business. > > Why were you trying to speculate in resp

Re: List of WindowsError error codes and meanings

2011-05-27 Thread Andrew Berg
On 2011.05.26 10:02 AM, Thomas Heller wrote: > On Windows, you can use ctypes.FormatError(code) to map error codes > to strings: > > >>> import ctypes > >>> ctypes.FormatError(32) > 'Der Prozess kann nicht auf die Datei zugreifen, da sie von einem > anderen Prozess verwendet wird.' > >>> > > Fo

Re: Python's super() considered super!

2011-05-27 Thread Michele Simionato
On Friday, May 27, 2011 10:49:52 AM UTC+2, Ben Finney wrote: > The exquisite care that you describe programmers needing to maintain is IMO > just as much a deterrent as the super-is-harmful essay. Worth quoting. Also I think this article may encourage naive programmers along the dark path of coop

Re: Python's super() considered super!

2011-05-27 Thread Ben Finney
Raymond Hettinger writes: > Hope you enjoyed the post. I certainly did. But I'm not better enlightened on why ‘super’ is a good thing. The exquisite care that you describe programmers needing to maintain is IMO just as much a deterrent as the super-is-harmful essay. -- \“If you c

Re: Why did Quora choose Python for its development?

2011-05-27 Thread Thorsten Kampe
* Steven D'Aprano (27 May 2011 03:07:30 GMT) > Okay, I've stayed silent while people criticize me long enough. What > exactly did I say that was impolite? Nothing. > John threw down a distinct challenge: > > if Python is really so much better than Python [sic] > readability wise, why

Re: Python's super() considered super!

2011-05-27 Thread Raymond Hettinger
On May 26, 6:39 pm, Ben Finney wrote: > We also, though, need *real* URLs. Blind URLs through obfuscation > services have their uses, but surely not in a forum like this. The real > URL is http://news.ycombinator.com/item?id=2588262>. Fair enough. I had copied the link from Jesse's tweet (where

Re: Link errors embedding Python 3.2

2011-05-27 Thread Chris Angelico
On Fri, May 27, 2011 at 12:45 PM, Ned Deily wrote: > > The discussion in http://bugs.python.org/issue4434 might be of some help. Thanks Ned! That was most helpful. I'm still not sure exactly what I changed, but between building with --enable-shared and some fiddling with how I link my program, I'

Re: The worth of comments

2011-05-27 Thread Tim Roberts
Roy Smith wrote: > >Over the years, my use of comments has evolved. I was taught, "You >should comment your code". Eventually, I came to realize that the real >mandate is, "You should make it easy to understand your code". Comments >are just one possible tool to help achieve that goal. Abso