Re: Unicode humor

2013-05-11 Thread Steven D'Aprano
On Sat, 11 May 2013 01:16:36 +1000, Chris Angelico wrote: > On Sat, May 11, 2013 at 1:06 AM, jmfauth wrote: >> On 8 mai, 15:19, Roy Smith wrote: >>> Apropos to any of the myriad unicode threads that have been going on >>> recently: >>> >>> http://xkcd.com/1209/ >> >> -- >> >> >> This reflect

Re: object.enable() anti-pattern

2013-05-11 Thread Steven D'Aprano
On Fri, 10 May 2013 17:59:26 +0100, Nobody wrote: > On Thu, 09 May 2013 05:23:59 +, Steven D'Aprano wrote: > >> There is no sensible use-case for creating a file without opening it. >> What would be the point? Any subsequent calls to just about any method >> will fail. Since you have to open

Re: object.enable() anti-pattern

2013-05-11 Thread Steven D'Aprano
On Fri, 10 May 2013 18:20:34 +0100, Robert Kern wrote: > According to Steven's criteria, neither of these are instances of the > anti-pattern because there are good reasons they are this way. He is > reducing the anti-pattern to just those cases where there is no reason > for doing so. But isn't

Re: Making safe file names

2013-05-11 Thread Andrew Berg
On 2013.05.08 18:37, Dennis Lee Bieber wrote: > And now you've seen why music players don't show the user the > physical file name, but maintain a database mapping the internal data > (name, artist, track#, album, etc.) to whatever mangled name was needed > to satisfy the file system. Tags ar

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread D'Arcy J.M. Cain
On Thu, 9 May 2013 11:33:45 -0600 Ian Kelly wrote: > about Turing machines and lambda calculus that you've injected into > the conversation though just reminds me of the "Einstein was wrong" > cranks. But Einstein *was* wrong. http://www.xkcd.com/1206/ -- D'Arcy J.M. Cain | Democracy

Re: object.enable() anti-pattern

2013-05-11 Thread Mark Janssen
>> In the old days, it was useful to have fine-grained control over the >> file object because you didn't know where it might fail, and the OS >> didn't necessarily give you give good status codes. So being able to >> step through the entire process was the job of the progammers. > > I don't know

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Mark Janssen
> ...The field needs re-invented and re-centered.[...] For anyone who want to be involved. See the wikiwikiweb -- a tool that every programmer should know and use -- and these pages: ComputerScienceVersionTwo and ObjectOrientedRefactored. Cheers! -- MarkJ Tacoma, Washington -- http://mail.pyt

Re: Unicode humor

2013-05-11 Thread Chris Angelico
On Sat, May 11, 2013 at 2:07 AM, rusi wrote: > On May 10, 8:32 pm, Chris Angelico wrote: >> On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder >> wrote: >> > On 5/10/2013 11:06 AM, jmfauth wrote: >> >> >> On 8 mai, 15:19, Roy Smith wrote: >> >> >>> Apropos to any of the myriad unicode threads tha

Re: Making safe file names

2013-05-11 Thread Chris Angelico
On Thu, May 9, 2013 at 1:08 PM, Steven D'Aprano wrote: > I suspect that the only way to be completely ungoogleable would be to > name yourself something common, not something obscure. Say, if you called > yourself "Hard Rock Band", and did hard rock. But then, googling for > "Heavy Metal" alone br

Re: object.enable() anti-pattern

2013-05-11 Thread Mark Janssen
> Steven, don't be misled. POSIX is not the model to look to -- it does > not acknowledge that files are actual objects that reside on a piece > of hardware. It is not simply an integer. Please disregard this (my own) flame bait. -- MarkJ Tacoma, Washington -- http://mail.python.org/mailman/li

Re: Append to python List

2013-05-11 Thread Chris Angelico
On Thu, May 9, 2013 at 9:30 PM, Jussi Piitulainen wrote: > 8 Dihedral writes: > >> This is just the handy style for a non-critical loop. >> In a critical loop, the number of the total operation counts >> does matter in the execution speed. > > Do you use speed often? Dihedral is a bot. Quite

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Chris Angelico
On Fri, May 10, 2013 at 3:33 AM, Ian Kelly wrote: > All this irrelevant nonsense > about Turing machines and lambda calculus that you've injected into > the conversation though just reminds me of the "Einstein was wrong" > cranks. http://xkcd.com/1206/ ChrisA -- http://mail.python.org/mailman/l

Re: Unicode humor

2013-05-11 Thread Mark Lawrence
On 10/05/2013 17:25, Chris Angelico wrote: On Sat, May 11, 2013 at 2:07 AM, rusi wrote: On May 10, 8:32 pm, Chris Angelico wrote: On Sat, May 11, 2013 at 1:24 AM, Ned Batchelder wrote: On 5/10/2013 11:06 AM, jmfauth wrote: On 8 mai, 15:19, Roy Smith wrote: Apropos to any of the myria

Re: Unicode humor

2013-05-11 Thread Chris Angelico
On Sat, May 11, 2013 at 10:40 PM, Mark Lawrence wrote: > This simply shows bias to the English speaking world, as does Python > unicode, at least in 3.3+. I wouldn't mind betting that other languages > can't cope, e.g. can 3.3+ manage the top secret joke that's so deadly even > the Germans die la

Re: object.enable() anti-pattern

2013-05-11 Thread Roy Smith
In article <518df898$0$29997$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I never intended to give the impression that *any* use of a separate > "enable" method call was bad. I certainly didn't intend to be bogged > down into a long discussion about the minutia of file descrip

Re: object.enable() anti-pattern

2013-05-11 Thread André Malo
* Serhiy Storchaka wrote: > Another example is running a subprocess in Unix-like systems. > > fork() > open/close file descriptors, set limits, etc > exec*() For running a subprocess, only fork() is needed. For starting another executable, only exec() is needed. For running the ne

Re: Append to python List

2013-05-11 Thread Anssi Saari
Chris Angelico writes: > On Thu, May 9, 2013 at 9:30 PM, Jussi Piitulainen > wrote: >> 8 Dihedral writes: >> >>> This is just the handy style for a non-critical loop. >>> In a critical loop, the number of the total operation counts >>> does matter in the execution speed. >> >> Do you use sp

Re: Append to python List

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 1:47 AM, Anssi Saari wrote: > Chris Angelico writes: > >> On Thu, May 9, 2013 at 9:30 PM, Jussi Piitulainen >> wrote: >>> 8 Dihedral writes: >>> This is just the handy style for a non-critical loop. In a critical loop, the number of the total operation coun

Re: object.enable() anti-pattern

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 1:33 AM, André Malo wrote: > * Serhiy Storchaka wrote: > >> Another example is running a subprocess in Unix-like systems. >> >> fork() >> open/close file descriptors, set limits, etc >> exec*() > > For running a subprocess, only fork() is needed. For starting

Re: Right way to initialize python embedded in a multi-threaded application

2013-05-11 Thread francis . brosnan
Hi, Maybe you already fixed the issue, but for the record, I've got the same problem and finally it turned out that I was calling PyEval_InitThreads twice and also after fixing that, I also had to move the call to PyEval_ReleaseLock(); at the end of the entire initialization (not just after PyE

Re: object.enable() anti-pattern

2013-05-11 Thread Robert Kern
On 2013-05-11 08:51, Steven D'Aprano wrote: On Fri, 10 May 2013 18:20:34 +0100, Robert Kern wrote: According to Steven's criteria, neither of these are instances of the anti-pattern because there are good reasons they are this way. He is reducing the anti-pattern to just those cases where there

Python for philosophers

2013-05-11 Thread Citizen Kant
Hi, this could be seen as an extravagant subject but that is not my original purpose. I still don't know if I want to become a programmer or not. At this moment I'm just inspecting the environment. I'm making my way to Python (and OOP in general) from a philosophical perspective or point of view an

Re: Right way to initialize python embedded in a multi-threaded application

2013-05-11 Thread francis . brosnan
Just clarify there's no problem about calling twice to PyEval_InitThreads () as indicated by Python's doc. > Hi, > > > > Maybe you already fixed the issue, but for the record, I've got the same > > problem and finally it turned out that I was calling PyEval_InitThreads twice > > and also afte

Re: Python for philosophers

2013-05-11 Thread Mark Janssen
On Sat, May 11, 2013 at 1:03 PM, Citizen Kant wrote: >[...] the starting question I make to myself about Python is: which is the >single > and most basic use of Python as the entity it is? I mean, beside > programming, what's the single and most basic result one can expect from > "interacting" wi

Re: Python for philosophers

2013-05-11 Thread Fábio Santos
On 11 May 2013 21:07, "Citizen Kant" wrote: > > Hi, > this could be seen as an extravagant subject but that is not my original purpose. I still don't know if I want to become a programmer or not. At this moment I'm just inspecting the environment. I'm making my way to Python (and OOP in general) f

Re: Python for philosophers

2013-05-11 Thread alex23
On 12 May, 06:10, Mark Janssen wrote: > Wow.  You must be from another planet.  Find Socrates if you wish to > know these things.  He's from there also. Now now, there's no need for a turf war, there's plenty of room on this list for crazies. -- http://mail.python.org/mailman/listinfo/python-li

Re: in need of some help...

2013-05-11 Thread Jens Thoms Toerring
Alex Norton wrote: > On Wednesday, 1 May 2013 13:15:28 UTC+1, Jens Thoms Toerring wrote: > > Of course, it might be nicer to have a "result" label some- > > where in the graphical interface which you set to the text > > instead of printing it out to the console. And you also will > > probably add

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread alex23
On 10 May, 13:07, Chris Angelico wrote: > Now, whether or not it's worth _debating_ the expressiveness of a > language... well, that's another point entirely. But for your major > project, I think you'll do better working in Python than in machine > code. I wasn't disagreeing with the concept of

Re: object.enable() anti-pattern

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 5:55 AM, Robert Kern wrote: >> Another example of temporal coupling is json_decode in PHP: you must >> follow it by a call to json_last_error, otherwise you have no way of >> telling whether the json_decode function succeeded or not. >> >> http://php.net/manual/en/function.

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 5:32 AM, Dennis Lee Bieber wrote: > On Fri, 10 May 2013 14:33:52 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: > >> >> I don't answer to them. I also believe in a path of endless >> exponential growth. Challenge: Create more information than

Re: Red Black Tree implementation?

2013-05-11 Thread Dan Stromberg
I'm afraid I'm having some trouble with the module. I've checked it into my SVN at http://stromberg.dnsalias.org/svn/red-black-tree-mod/trunk/duncan I have two versions of your tests in there now - "t" is minimally changed, and test-red_black_tree_mod is pretty restructured to facilitate adding m

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Gregory Ewing
Dennis Lee Bieber wrote: I also believe in a path of endless exponential growth. Challenge: Create more information than can be stored in one teaspoon of matter. Go ahead. Try! If that's your argument, then you don't really believe in *endless* exponential growth. You only believe in "exponenti

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Gregory Ewing
Chris Angelico wrote: On Sun, May 12, 2013 at 5:32 AM, Dennis Lee Bieber wrote: The coordinates of each particle storing the information in that teaspoon of matter. Which is probably more data than any of us will keyboard in a lifetime. Hence my point. My 1TB hard disk *already* co

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 10:50 AM, Gregory Ewing wrote: > Dennis Lee Bieber wrote: >>> >>> I also believe in a path of endless >>> exponential growth. Challenge: Create more information than can be >>> stored in one teaspoon of matter. Go ahead. Try! > > > If that's your argument, then you don't re

Re: Message passing syntax for objects | OOPv2

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 11:02 AM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> On Sun, May 12, 2013 at 5:32 AM, Dennis Lee Bieber >> wrote: > > >>>The coordinates of each particle storing the information in that >>> teaspoon of matter. >> >> >> Which is probably more data than any o

Re: Red Black Tree implementation?

2013-05-11 Thread Dan Stromberg
On Sat, May 11, 2013 at 4:24 PM, Dan Stromberg wrote: > > I'm afraid I'm having some trouble with the module. I've checked it into > my SVN at > http://stromberg.dnsalias.org/svn/red-black-tree-mod/trunk/duncan > > I have two versions of your tests in there now - "t" is minimally changed, > and

Re: Python for philosophers

2013-05-11 Thread Gregory Ewing
Citizen Kant wrote: I roughly came to the idea that Python could be considered as an *economic mirror for data*, one that mainly *mirrors* the data the programmer types on its black surface, not exactly as the programmer originally typed it, but expressed in the most economic way possible. A

Re: Red Black Tree implementation?

2013-05-11 Thread duncan smith
On 12/05/13 00:24, Dan Stromberg wrote: I'm afraid I'm having some trouble with the module. I've checked it into my SVN at http://stromberg.dnsalias.org/svn/red-black-tree-mod/trunk/duncan I have two versions of your tests in there now - "t" is minimally changed, and test-red_black_tree_mod is

Re: Red Black Tree implementation?

2013-05-11 Thread duncan smith
On 12/05/13 02:29, Dan Stromberg wrote: On Sat, May 11, 2013 at 4:24 PM, Dan Stromberg mailto:drsali...@gmail.com>> wrote: I'm afraid I'm having some trouble with the module. I've checked it into my SVN at http://stromberg.dnsalias.org/svn/red-black-tree-mod/trunk/duncan I ha

Re: Append to python List

2013-05-11 Thread 88888 Dihedral
Chris Angelico於 2013年5月12日星期日UTC+8上午12時00分44秒寫道: > On Sun, May 12, 2013 at 1:47 AM, Anssi Saari wrote: > > > Chris Angelico writes: > > > > > >> On Thu, May 9, 2013 at 9:30 PM, Jussi Piitulainen > > >> wrote: > > >>> 8 Dihedral writes: > > >>> > > This is just the handy style for

Re: Append to python List

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 12:29 PM, 8 Dihedral wrote: > Chris Angelico於 2013年5月12日星期日UTC+8上午12時00分44秒寫道: >> Most humans would get defensive, or at >> least protest, if treated as bots; Dihedral never has, despite being >> referred to in this way a number of times. >> >> ChrisA > > Don't you get

Re: Python for philosophers

2013-05-11 Thread Ned Batchelder
On 5/11/2013 4:03 PM, Citizen Kant wrote: Hi, this could be seen as an extravagant subject but that is not my original purpose. I still don't know if I want to become a programmer or not. At this moment I'm just inspecting the environment. I'm making my way to Python (and OOP in general) from

Re: Python for philosophers

2013-05-11 Thread Joel Goldstick
On Sat, May 11, 2013 at 4:03 PM, Citizen Kant wrote: > Hi, > this could be seen as an extravagant subject but that is not my original > purpose. I still don't know if I want to become a programmer or not. My guess is that you don't want to be a programmer. Otherwise you would know that you did

Re: Python for philosophers

2013-05-11 Thread rusi
On May 12, 3:16 am, alex23 wrote: > On 12 May, 06:10, Mark Janssen wrote: > > > Wow.  You must be from another planet.  Find Socrates if you wish to > > know these things.  He's from there also. > > Now now, there's no need for a turf war, there's plenty of room on > this list for crazies. I'm r

Re: Python for philosophers

2013-05-11 Thread Chris Angelico
On Sun, May 12, 2013 at 2:22 PM, rusi wrote: > On May 12, 3:16 am, alex23 wrote: >> On 12 May, 06:10, Mark Janssen wrote: >> >> > Wow. You must be from another planet. Find Socrates if you wish to >> > know these things. He's from there also. >> >> Now now, there's no need for a turf war, the

Re: Python for philosophers

2013-05-11 Thread rusi
On May 12, 9:22 am, rusi wrote: > On May 12, 3:16 am, alex23 wrote: > > > On 12 May, 06:10, Mark Janssen wrote: > > > > Wow.  You must be from another planet.  Find Socrates if you wish to > > > know these things.  He's from there also. > > > Now now, there's no need for a turf war, there's plen

Re: Python for philosophers

2013-05-11 Thread Steven D'Aprano
On Sat, 11 May 2013 21:45:12 -0700, rusi wrote: > I have on occasion expressed that newcomers to this list should be > treated with more gentleness than others. And since my own joking may be > taken amiss, let me hasten to add (to the OP -- Citizen Kant) A noble aim, but I have a feeling that "C

Re: Append to python List

2013-05-11 Thread Jussi Piitulainen
Chris Angelico writes: > On Thu, May 9, 2013 at 9:30 PM, Jussi Piitulainen wrote: > > 8 Dihedral writes: > > > >> This is just the handy style for a non-critical loop. > >> In a critical loop, the number of the total operation counts > >> does matter in the execution speed. > > > > Do you use