RE: Popen and reading stdout in windows

2013-06-10 Thread Joseph L. Casale
> You leave out an awful amount of detail. I have no idea what ST is, so > I'll have to guess your real problem. Ugh, sorry guys its been one of those days, the post was rather useless... I am using Popen to run the exe with communicate() and I have sent stdout to PIPE without luck. Just not su

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 5:53 am, Mark Janssen wrote: > > There's a subtle difference between a keyword and a built-in.  Good > > Python style generally avoids masking built-ins but allows it: > > Right, thank you for reminding me.  My C-mind put them in the same category. > -- > MarkJ > Tacoma, Washington Don

Re: Sorting a set works, sorting a dictionary fails ?

2013-06-10 Thread Denis McMahon
On Mon, 10 Jun 2013 03:42:38 -0700, Νικόλαος Κούρας wrote: > for key in sorted( months.values() ): > print(''' >%s > ''' % (months[key], key) ) > == > > please tell me Uli why this dont work as expected to. Because inside the for loop, your value 'key' i

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 5:14 am, Terry Jan Reedy wrote: > Many long-time posters have advised "Don't rebind built-in names*. > > * Unless you really mean to mask it, or more likely wrap it, such as > wrapping print to modify some aspect of its operation than one cannot do > with its keyword parameters. The poi

Re: Re-using copyrighted code

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 08:42:07 +0200, Malte Forkel wrote: > Am 10.06.2013 07:31, schrieb Steven D'Aprano: >> >> But bringing it back to the original topic, I believe that the >> philosophy of FOSS is that we should try our best to honour the >> intentions of the writer, not to find some legal looph

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 17:20:58 -0700, Mark Janssen wrote: >>> list = [] >>> Reading further, one sees that the function works with two lists, a >>> list of file names, unfortunately called 'list', >> >> That is very good advice in general: never choose a variable name that >> is a keyword.

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 20:14:55 -0400, Terry Jan Reedy wrote: > For instance, open Lib/idlelib/GrepDialog.py in an editor that colorizes > Python syntax, such as Idle's editor, jump down to the bottom and read > up, and (until it is patched) find > list.append(fn) > with 'list' c

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 19:36:44 -0700, rusi wrote: > Pascal introduced the idea of block structure -- introduce a name at one > level, override it at a lower level. [Ok ALgol introduced, Pascal > popularized]. > This has caused more trouble than it has solved. I take it you have never programmed in

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 8:02 am, Steven D'Aprano wrote: > On Mon, 10 Jun 2013 19:36:44 -0700, rusi wrote: > > Pascal introduced the idea of block structure -- introduce a name at one > > level, override it at a lower level. [Ok ALgol introduced, Pascal > > popularized]. > > This has caused more trouble than it

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Jason Swails
On Mon, Jun 10, 2013 at 7:26 PM, Dave Angel wrote: > On 06/10/2013 06:54 PM, Chris Angelico wrote: > >> On Tue, Jun 11, 2013 at 8:39 AM, Grant Edwards >> wrote: >> >>> On 2013-06-10, Terry Jan Reedy wrote: >>> >>> Another principle similar to 'Don't add extraneous code' is 'Don't rebind b

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Chris Angelico
On Tue, Jun 11, 2013 at 1:02 PM, Steven D'Aprano wrote: > Apart from Erlang, got any other examples? Because it seems to me that in > languages with nested scopes or namespaces, shadowing higher levels is > exactly the right thing to do. Certainly it would be a PITA, and defeat > the purpose of ha

Re: Split a list into two parts based on a filter?

2013-06-10 Thread Roy Smith
In article , Roel Schroeven wrote: > new_songs, old_songs = [], [] > [(new_songs if s.is_new() else old_songs).append(s) for s in songs] Thanks kind of neat, thanks. I'm trying to figure out what list gets created and discarded. I think it's [None] * len(songs). -- http://mail.python.org/ma

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Steven D'Aprano
On Mon, 10 Jun 2013 20:30:41 -0700, rusi wrote: >> Certainly it would be a PITA, and defeat the purpose of having nested >> scopes, if inner names had to be globally unique. Wouldn't it be >> absolutely horrible if adding a global variable "foo"[1] suddenly meant >> that all your functions that us

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread Terry Jan Reedy
On 6/10/2013 10:56 PM, Steven D'Aprano wrote: I was initially confused and reading the code still takes a small bit of extra mental energy. Idle stays confused and will wrongly color the list instance name until it is changed. Calling the file list 'fnames' or 'filenames' would have been clearer

Re: Split a list into two parts based on a filter?

2013-06-10 Thread Peter Otten
Fábio Santos wrote: > On 10 Jun 2013 23:54, "Roel Schroeven" wrote: >> >> You could do something like: >> >> new_songs, old_songs = [], [] >> [(new_songs if s.is_new() else old_songs).append(s) for s in songs] >> >> But I'm not sure that that's any better than the long version. > > This is so be

Re: Split a list into two parts based on a filter?

2013-06-10 Thread Jonas Geiregat
On 11 Jun 2013, at 01:08, Fábio Santos wrote: > > On 10 Jun 2013 23:54, "Roel Schroeven" wrote: > > > > You could do something like: > > > > new_songs, old_songs = [], [] > > [(new_songs if s.is_new() else old_songs).append(s) for s in songs] > > > > But I'm not sure that that's any better than

Re: Simple program question.

2013-06-10 Thread eschneider92
No. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2