Re: running python 2 vs 3

2014-03-20 Thread Rustom Mody
On Friday, March 21, 2014 2:23:25 AM UTC+5:30, Ned Batchelder wrote: On 3/20/14 4:42 PM, Marko Rauhamaa wrote: Ned Batchelder : Plenty of people have adopted a dual-support strategy, with one code base that supports both Python 2 and Python 3. The six module can help a great deal with

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Rustom Mody
On Friday, March 21, 2014 8:53:49 AM UTC+5:30, wrote: On Thursday, March 20, 2014 11:16:50 PM UTC-4, Dave Angel wrote: Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: 1. two('y',

Re: running python 2 vs 3

2014-03-21 Thread Rustom Mody
On Friday, March 21, 2014 11:38:42 AM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : Then you're probably not using sys.stdout.write but some other file object's write method. Correct, sys.stderr.write would have been a more accurate choice. Also, I find it highly unusual that you

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 2:12:53 AM UTC+5:30, vasudevram wrote: Hi list, Can anyone - maybe one of the Python language core team, or someone with knowledge of the internals of Python - can explain why this code works, and whether the different occurrences of the name x in the expression,

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 2:26:09 AM UTC+5:30, vasudevram wrote: On Saturday, March 22, 2014 2:24:00 AM UTC+5:30, Rustom Mody wrote: Lets try without comprehending comprehensions :-) x=[[1,2],[3,4]] for x in x: ... for x in x: ... print x ... 1 2 3 4 Nice

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 3:00:10 AM UTC+5:30, Ian wrote: On Fri, Mar 21, 2014 at 3:09 PM, Rustom Mody wrote: A 'for' introduces a scope: This is false. And On Saturday, March 22, 2014 3:04:48 AM UTC+5:30, Gregory Ewing wrote: A 'for' introduces a scope: No, it doesn't! Ha

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 8:11:27 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 1:06 PM, Rustom Mody wrote: Two: A comprehension variable is not bound but reassigned across the comprehension. This problem remains in python3 and causes weird behavior when lambdas are put

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 10:21:13 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 3:39 PM, Rustom Mody wrote: So if that's not going to be broken, how is this fundamentally different? def func_loop(): for x in 1,2,3: yield (lambda: x) Thats using a for-loop

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-21 Thread Rustom Mody
On Saturday, March 22, 2014 10:21:13 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 22, 2014 at 3:39 PM, Rustom Mody wrote: So if that's not going to be broken, how is this fundamentally different? def func_loop(): for x in 1,2,3: yield (lambda: x) Thats using a for-loop

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-22 Thread Rustom Mody
On Saturday, March 22, 2014 2:39:56 PM UTC+5:30, Ian wrote: On Fri, Mar 21, 2014 at 8:06 PM, Rustom Mody wrote: Two: A comprehension variable is not bound but reassigned across the comprehension. This problem remains in python3 and causes weird behavior when lambdas are put

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-22 Thread Rustom Mody
On Saturday, March 22, 2014 7:52:28 PM UTC+5:30, Ian wrote: On Mar 20, 2014 9:59 PM, Dave Angel da...@davea.name wrote:  dtra...@gmail.com Wrote in message: And I was wondering how I would add the partenthesis because I tried: return numtochar(c1 + c2 (%26)) and it gave me an error.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-22 Thread Rustom Mody
The foll is fairly standard fare in denotational semantics -- please excuse the length! In order to understand (formally) the concept of 'variable' we need to have at the least a concept of name(or identifier) - value mapping. This mapping is called an 'environment' If we stop at that we get the

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-22 Thread Rustom Mody
On Sunday, March 23, 2014 8:16:28 AM UTC+5:30, Ian wrote: On Sat, Mar 22, 2014 at 6:32 PM, Rhodri James wrote: wrote: Well almost... Except that the 'loop' I am talking of is one of def loop(): return [yield (lambda: x) for x in [1,2,3]] or return (yield (lambda: x) for x

Re: Help needed to create a Python extension library for an existing shared memory hash table library

2014-03-23 Thread Rustom Mody
On Sunday, March 23, 2014 6:37:11 PM UTC+5:30, Jens Thoms Toerring wrote: Simon Hardy-Francis wrote: Hi Python fans, I just released my first open source project ever called SharedHashFile [1]. It's a shared memory hash table written in C. Some guy on Quora asked [2] whether there's an

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-23 Thread Rustom Mody
On Monday, March 24, 2014 8:57:32 AM UTC+5:30, Chris Angelico wrote: On Mon, Mar 24, 2014 at 1:35 PM, Rhodri James wrote: Would you not consider this to be declarative? x = [1, 2, 3] I'm not sure I would. I look at that line of code and think of it as Create a list..., very much in

Re: Question about Source Control

2014-03-24 Thread Rustom Mody
On Monday, March 17, 2014 6:36:33 PM UTC+5:30, Frank Millman wrote: Hi all I know I *should* be using a Source Control Management system, but at present I am not. I tried to set up Mercurial a couple of years ago, but I think I set it up wrongly, as I got myself confused and found it more

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-24 Thread Rustom Mody
On Monday, March 24, 2014 7:34:59 PM UTC+5:30, Steven D'Aprano wrote: On Mon, 24 Mar 2014 22:49:38 +1100, Chris Angelico wrote: wrote: You never *need* (Python's) lambda for anything. Inner functions are more capable and almost always more readable. It doesn't hurt to have lambda, but I

Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 5:28:11 AM UTC+5:30, Ian wrote: On Mon, Mar 24, 2014 at 3:43 PM, Mark H Harris wrote: On 3/24/14 4:03 AM, Ian Kelly wrote: The difference does not really lie in the lambda construct per se but in the binding style of closures. Functional languages tend to go one

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 8:47:35 AM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 2:00 PM, Rustom Mody wrote: Yeah: Its 2014 (at least out here)... About time we started using unicode in earnest dont you think?? We do. Id like to see the following spellings corrected

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 12:28:16 AM UTC+5:30, Mark H. Harris wrote: On 3/24/14 4:58 AM, Mark Lawrence wrote: Where do you get reduce from if it's not in the standard library? That was a proposal for 3000. Its there, but its not on the built-ins; ie., you have to import it. The

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 8:47:35 AM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 2:00 PM, Rustom Mody wrote: Yeah: Its 2014 (at least out here)... About time we started using unicode in earnest dont you think?? We do. Id like to see the following spellings corrected

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 9:29:57 AM UTC+5:30, Mark H. Harris wrote: On 3/24/14 10:51 PM, Chris Angelico wrote: Supporting both may look tempting, but you effectively create two ways of spelling the exact same thing; it'd be like C's trigraphs. Do you know what ??= is, This was a fit for

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 9:59:48 AM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 3:08 PM, Rustom Mody wrote: And Chris is right in (rephrasing) we may have unicode-happy OSes and languages. We cant reasonably have unicode-happy keyboards. [What would a million-key keyboard

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 10:38:43 AM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 4:00 PM, Rustom Mody wrote: Its already there -- and even easier Switch to cyrillic-jis-russian (whatever that is!) and I get л from k Л from K How quickly can you switch, type one letter

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 10:44:42 AM UTC+5:30, Mark H. Harris wrote: On 3/25/14 12:08 AM, Chris Angelico wrote: How quickly can you switch, type one letter (to generate one Cyrillic character), and switch back? ... very fast. Is not this nicer? Π = pi sin(Π/4)

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-24 Thread Rustom Mody
On Tuesday, March 25, 2014 11:04:40 AM UTC+5:30, Mark H. Harris wrote: On 3/25/14 12:27 AM, Chris Angelico wrote: my pdeclib constants extension will have alternate spellings for Π and Γ and Δ and others... That's good! (Although typing Π quicker than pi is majorly pushing it.

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 11:17:51 AM UTC+5:30, Steven D'Aprano wrote: On Tue, 25 Mar 2014 14:57:02 +1100, Chris Angelico wrote: wrote: What you are missing is that programmers spend 90% of their time reading code 10% writing code You may well be in the super-whiz category (not being

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 11:42:50 AM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 4:47 PM, Steven D'Aprano wrote: On Tue, 25 Mar 2014 14:57:02 +1100, Chris Angelico wrote: No, I'm not missing that. But the human brain is a tokenizer, just as Python is. Once you know what a

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 12:03:24 PM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 5:10 PM, Rustom Mody wrote: Something that Chris may relate to: You type a music score into lilypond Then call lilypond to convert it into standard western staff notation Why not put up

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 12:15:11 PM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 5:35 PM, Rustom Mody wrote: I dont think we are anywhere near making real suggestions for real changes which would need to talk of compatibility, portability, editor support and all such other

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 12:33:49 PM UTC+5:30, Steven D'Aprano wrote: On Mon, 24 Mar 2014 20:56:19 -0700, Rustom Mody wrote: Paren vs tuples: why do we need to write (x,) not (x) You don't. You can write x, without the brackets: py t = 23, py type(t) It's the comma that makes tuples

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 5:16:14 PM UTC+5:30, Antoon Pardon wrote: On 25-03-14 12:14, Steven D'Aprano wrote: Would such a use already indicate I should use a mathematical front-end? When a programming language is borrowing concepts from mathematics, I see no reason not to borrow the

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 4:08:38 PM UTC+5:30, Antoon Pardon wrote: So? We do use + -, so why shouldn't we use × for multiplication. Would such a use already indicate I should use a mathematical front-end? When a programming language is borrowing concepts from mathematics, I see no reason

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 6:15:16 PM UTC+5:30, Chris Angelico wrote: On Tue, Mar 25, 2014 at 11:07 PM, Antoon Pardon On 25-03-14 12:12, Chris Angelico wrote: On Tue, Mar 25, 2014 at 9:24 PM, Antoon Pardon No they didn't have to. With the transition to python3, the developers could have

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:26:47 PM UTC+5:30, Chris Angelico wrote: On Wed, Mar 26, 2014 at 12:43 AM, Antoon Pardon It doesn't bother me. IIRC in primary school before fractions were introduced, a colon was used to indicate division. The way I learned it, a colon was for a ratio, and a

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:13:09 PM UTC+5:30, Antoon Pardon wrote: On 25-03-14 13:53, Rustom Mody wrote: On Tuesday, March 25, 2014 4:08:38 PM UTC+5:30, Antoon Pardon wrote: So? We do use + -, so why shouldn't we use × for multiplication. Would such a use already indicate I should use

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Tuesday, March 25, 2014 7:53:23 PM UTC+5:30, Steven D'Aprano wrote: On Tue, 25 Mar 2014 05:53:45 -0700, Rustom Mody wrote: And if we had hyphen '‐' distinguished from minus '-' then we could have lispish names like call‐with‐current‐continuation properly spelt. And then generations

Re: unicode as valid naming symbols

2014-03-25 Thread Rustom Mody
On Wednesday, March 26, 2014 12:22:40 AM UTC+5:30, wxjm...@gmail.com wrote: Le mardi 25 mars 2014 19:30:34 UTC+1, Mark H. Harris a écrit : greetings, I would like to create a lamda as follows: √ = lambda n: sqrt(n) On my keyboard mapping the problem character is alt-v which produces the

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-25 Thread Rustom Mody
On Wednesday, March 26, 2014 10:00:21 AM UTC+5:30, Terry Reedy wrote: On 3/25/2014 8:12 PM, Steven D'Aprano wrote: On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote: On 3/25/2014 11:18 AM, Steven D'Aprano wrote: The thing is, we can't just create a ∑ function, because it doesn't work

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Wednesday, March 26, 2014 9:35:53 PM UTC+5:30, Steven D'Aprano wrote: On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote: On 3/25/2014 8:12 PM, Steven D'Aprano wrote: On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote: On 3/25/2014 11:18 AM, Steven D'Aprano wrote: The thing is,

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Wednesday, March 26, 2014 11:02:04 PM UTC+5:30, Rustom Mody wrote: On Wednesday, March 26, 2014 9:35:53 PM UTC+5:30, Steven D'Aprano wrote: On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote: One passes an unquoted expression in code by quoting it with either lambda, paired quote

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 5:13:21 AM UTC+5:30, Steven D'Aprano wrote: On Thu, 27 Mar 2014 09:24:49 +1100, Chris Angelico wrote: wrote: Now actual python def sumjensen(i_get, i_set,lower,upper,exp): tot = 0 i_set(lower) while i_get() = upper: tot += exp_get()

Re: regex line by line over file

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 8:53:29 AM UTC+5:30, James Smith wrote: I can't get this to work. It runs but there is no output when I try it on a file. #!/usr/bin/python import os import sys import re from datetime import datetime #logDir =

Re: Delayed evaluation of expressions

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 4:15:19 AM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : You prove here that Python has first-class expressions in the same way that 80x86 assembly language has garbage collection. Sure, you can implement it using the primitives you have, but that's not

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 3:06:02 PM UTC+5:30, Antoon Pardon wrote: On 26-03-14 17:37, Ian Kelly wrote: On Wed, Mar 26, 2014 at 2:52 AM, Antoon Pardon Of course we don't have to follow mathematical convention with python. However allowing any unicode symbol as an identifier doesn't

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 8:58:51 PM UTC+5:30, Mark H. Harris wrote: On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do not think it means what you think it means.” In~con~theveable ! My name is Inigo Montoya, you

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 9:52:40 PM UTC+5:30, Ian wrote: On Thu, Mar 27, 2014 at 9:28 AM, Mark H Harris wrote: Do you think that the ability to write this would be an improvement? import ⌺ ⌚ = ⌺.╩░ ⑥ = 5*⌺.⋨⋩ ❹ = ⑥ - 1 ♅⚕⚛ = [⌺.✱✳**⌺.❇*❹{⠪|⌚.∣} for ⠪ in ⌺.⣚] ⌺.˘˜¨´՛՜(♅⚕⚛)

Re: unicode as valid naming symbols

2014-03-27 Thread Rustom Mody
On Thursday, March 27, 2014 10:47:04 PM UTC+5:30, MRAB wrote: On 2014-03-27 15:51, Rustom Mody wrote: On Thursday, March 27, 2014 8:58:51 PM UTC+5:30, Mark H. Harris wrote: On 3/25/14 6:58 PM, Steven D'Aprano wrote: To quote a great Spaniard: “You keep using that word, I do

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Rustom Mody
On Friday, March 28, 2014 3:44:09 AM UTC+5:30, Mark H. Harris wrote: On 3/27/14 4:42 PM, Chris Angelico wrote: And this is the bit where, I think, we disagree. I think that programming is for programmers, in the same way that music is for musicians and the giving of legal advice is for

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-27 Thread Rustom Mody
On Friday, March 28, 2014 8:36:26 AM UTC+5:30, Chris Angelico wrote: On Fri, Mar 28, 2014 at 1:46 PM, Rustom Mody wrote: Moore’s Law isn’t a mythical beast that magically materialized in 1965 and threatens to unpredictably vanish at any moment. In fact, it’s part of a broader ancient

Re: meta language to define forms

2014-03-27 Thread Rustom Mody
On Friday, March 28, 2014 8:43:21 AM UTC+5:30, Roy Smith wrote: Chris Angelico wrote: Your syntax there looks reasonable already. I'd recommend you make it a flat data file, though, don't try to make it a programming language - unless you actively need it to be one. Here are a couple of

Re: meta language to define forms

2014-03-27 Thread Rustom Mody
On Friday, March 28, 2014 9:27:11 AM UTC+5:30, Chris Angelico wrote: On Fri, Mar 28, 2014 at 2:44 PM, Rustom Mody wrote: [BTW I consider the windows registry cleaner than the linux /etc for the same reason] And if I felt like trolling, I'd point out that there are a lot more search engine

Re: meta language to define forms

2014-03-28 Thread Rustom Mody
On Friday, March 28, 2014 2:34:07 PM UTC+5:30, alister wrote: On Fri, 28 Mar 2014 14:57:11 +1100, Chris Angelico wrote: wrote: [BTW I consider the windows registry cleaner than the linux /etc for the same reason] And if I felt like trolling, I'd point out that there are a lot more

Re: meta language to define forms

2014-03-28 Thread Rustom Mody
On Friday, March 28, 2014 5:44:48 PM UTC+5:30, Marko Rauhamaa wrote: Rustom Mody wrote: On the other hand in linux I find that when something is upgraded and needs to upgrade *its own* config files in /etc it can often have trouble. Linux (service) configuration has given me a lot

Re: YADTR (Yet Another DateTime Rant)

2014-03-28 Thread Rustom Mody
On Friday, March 28, 2014 6:52:15 PM UTC+5:30, Roy Smith wrote: Chris Angelico wrote: On Sat, Mar 29, 2014 at 12:10 AM, Marko Rauhamaa wrote: If encapsulation exists outside OO and inheritance is not key to it, what is OO then, a marketing term? Yep, OO is a marketing term. So's

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-28 Thread Rustom Mody
On Saturday, March 29, 2014 8:34:19 AM UTC+5:30, Mark H. Harris wrote: On 3/28/14 9:33 PM, Steven D'Aprano wrote: Mark, please stop posting to the newsgroup comp.lang.python AND the mailing list (...). They mirror each other. Your posts are not so important that we need to see everything

Re: unicode as valid naming symbols

2014-03-28 Thread Rustom Mody
On Saturday, March 29, 2014 12:25:45 AM UTC+5:30, rand...@fastmail.us wrote: On Thu, Mar 27, 2014, at 11:10, Rustom Mody wrote: Just out of curiosity how do/did you type that? When I see an exotic denizen from the unicode-universe I paste it into emacs and ask Who are you? But with your

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-28 Thread Rustom Mody
On Saturday, March 29, 2014 10:38:47 AM UTC+5:30, Chris Angelico wrote: On Sat, Mar 29, 2014 at 3:40 PM, Mark H Harris wrote: On 3/28/14 10:51 PM, Steven D'Aprano wrote: You are being patronising to the 94% of the world that is not from the USA. Do you honestly think that people all over

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Rustom Mody
On Saturday, March 29, 2014 11:21:17 AM UTC+5:30, Mark H. Harris wrote: On 3/29/14 12:08 AM, Chris Angelico wrote: Okay. History lesson time. Tell me what is the lingua franka today? Is it, E n g l i s h ? I wonder Mark, if because you are communicating with your mailing

Re: checking if two things do not equal None

2014-03-29 Thread Rustom Mody
On Sunday, March 30, 2014 8:09:45 AM UTC+5:30, Roy Smith wrote: I have no particular problem with x 2 y because it fits the same pattern. But, if you show me a != None != b: my brain just goes into overload. Honestly, I don't even know what that means. My brain keeps trying to

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-31 Thread Rustom Mody
On Monday, March 31, 2014 12:23:55 PM UTC+5:30, Ben Finney wrote: Mark, you are demonstrating a habit of making sweeping pronouncements and assertions; and then, when those statements are challenged, you act as though you never said them. Here's a characteristic example: Mark H Harris

Re: Code style query: multiple assignments in if/elif tree

2014-03-31 Thread Rustom Mody
On Monday, March 31, 2014 9:33:54 PM UTC+5:30, Chris Angelico wrote: On Tue, Apr 1, 2014 at 2:40 AM, Marko Rauhamaa wrote: As a simple layout question, I'd do it like this: if mode == Brake2: # Already got the

Re: Code style query: multiple assignments in if/elif tree

2014-03-31 Thread Rustom Mody
On Tue, Apr 1, 2014 at 3:26 PM, Steven D'Aprano wrote: Haskell has nifty pattern-matching syntax for this that looks quite close to the mathematical hybrid function syntax, but in Python, we're limited to explicitly using an if. If I were coding this, and I'm not, I'd wrap it in a function.

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 6:38:14 PM UTC+5:30, Chris Angelico wrote: On Tue, Apr 1, 2014 at 11:29 PM, Roy Smith wrote: But I confess that is mostly personal taste, since I find names_like_this ugly. Names-like-this look better to me but that wouldn't be workable in python. But maybe there

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 7:14:15 PM UTC+5:30, Chris Angelico wrote: On Wed, Apr 2, 2014 at 12:33 AM, Ned Batchelder wrote: Maybe I'm misunderstanding the discussion... It seems like we're talking about a hypothetical definition of identifiers based on Unicode character categories, but

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Tuesday, April 1, 2014 9:29:27 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa wrote: I implemented the loops in the scheme way. Recursion is how iteration is done by the Believers. Then I'm happily a pagan who uses while loops

Re: unicode as valid naming symbols

2014-04-01 Thread Rustom Mody
On Wednesday, April 2, 2014 8:28:02 AM UTC+5:30, Rustom Mody wrote: On Tuesday, April 1, 2014 9:29:27 PM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : On Wed, Apr 2, 2014 at 12:16 AM, Marko Rauhamaa wrote: I implemented the loops in the scheme way. Recursion is how iteration

Re: python nose unit test - test plan preparation

2014-04-02 Thread Rustom Mody
On Wednesday, April 2, 2014 6:52:04 PM UTC+5:30, Hareesha Karunakar wrote: Hello Group, I am using python's nose testing frame work for my automated testing. I would like to run my python cases and generate only the documentation without actually running/executing the cases. How is this

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Rustom Mody
On Wednesday, April 2, 2014 11:28:16 PM UTC+5:30, Roy Smith wrote: I have a big hairy data structure which is a tree of nested dicts. I have a sequence of strings which represents a path through the tree. Different leaves in the tree will be at different depths (which range from 1 to about

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Rustom Mody
On Thursday, April 3, 2014 8:11:33 AM UTC+5:30, Rustom Mody wrote: On Wednesday, April 2, 2014 11:28:16 PM UTC+5:30, Roy Smith wrote: I have a big hairy data structure which is a tree of nested dicts. I have a sequence of strings which represents a path through the tree. Different

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Rustom Mody
On Thursday, April 3, 2014 10:44:16 PM UTC+5:30, Marko Rauhamaa wrote: Mark H Harris: So, python(3)'s use of unicode is exciting, not only as a step forward for the python interpreter, but also as a leadership step forward in computer science around the world. Big words. I don't think

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Rustom Mody
On Friday, April 4, 2014 3:23:31 PM UTC+5:30, Steven D'Aprano wrote: On Thu, 03 Apr 2014 11:38:13 -0500, Mark H Harris wrote: On 4/1/14 5:33 PM, Terry Reedy wrote: hi Terry, hope you are well today, despite gmane difficulties; If you narrowly meant The python interpreter only

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Rustom Mody
On Saturday, April 5, 2014 2:28:29 AM UTC+5:30, Mark H. Harris wrote: hi Mark, yes that's my point. I have heard rumors of python2.8? At some point I would expect that the Cpython interpreter would 'freeze' and no one would fix it any longer. I have a serious question, namely, why does the

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-05 Thread Rustom Mody
On Saturday, April 5, 2014 11:27:08 AM UTC+5:30, Chris Angelico wrote: On Sat, Apr 5, 2014 at 4:29 PM, Ben Finney wrote: Without actual data - which neither of us has on this matter - all of these hypotheses are unfounded speculation. Let's not draw any conclusions in the absence of

Re: Mutable objects inside tuples - good or bad?

2014-04-06 Thread Rustom Mody
On Sunday, April 6, 2014 1:40:58 PM UTC+5:45, Devin Jeanpierre wrote: You can choose to define mutability that way, but in many contexts you'll find that definition not very useful. c is such that you could have another variable d, where the following interpreter session fragment is easily

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-06 Thread Rustom Mody
On Sunday, April 6, 2014 10:22:21 PM UTC+5:30, Steven D'Aprano wrote: On Sun, 06 Apr 2014 12:05:16 +0300, Marko Rauhamaa wrote: Mark H Harris : On 4/4/14 4:53 AM, Steven D'Aprano wrote: Python is not a computer-science-ey language. Every programming language is interesting from a comp

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-06 Thread Rustom Mody
On Sunday, April 6, 2014 11:24:15 PM UTC+5:30, Chris Angelico wrote: On Mon, Apr 7, 2014 at 3:31 AM, Rustom Mody wrote: However consider that some of the things that people did around 40 years ago and do today - use FORTRAN for numerical/simulation work -- now use scipy/sage etc - NLP

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-06 Thread Rustom Mody
On Monday, April 7, 2014 6:15:47 AM UTC+5:30, Terry Reedy wrote: On 4/6/2014 7:48 PM, Steven D'Aprano wrote: On Sun, 06 Apr 2014 23:10:47 +0300, Marko Rauhamaa wrote: Steven D'Aprano : On Sun, 06 Apr 2014 12:05:16 +0300, Marko Rauhamaa wrote: Python, BTW, is perfectly suitable for

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-06 Thread Rustom Mody
On Monday, April 7, 2014 12:16:54 AM UTC+5:30, Chris Angelico wrote: On Mon, Apr 7, 2014 at 4:13 AM, Rustom Mody wrote: Using Python at the design stage would be what Steven's talking about - actually using it to build the theory of programming. I have about as much experience in the area

Re: threading

2014-04-06 Thread Rustom Mody
On Monday, April 7, 2014 8:24:37 AM UTC+5:30, Onder Hazaroglu wrote: Hello, I've been using threading library to run some experiments parallel. There is no message passing between my threads but still it messes up somehow. The results are different than running it separated. Basically I

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-08 Thread Rustom Mody
On Tuesday, April 8, 2014 7:03:31 AM UTC+5:30, Mark H. Harris wrote: I have another question for y'all, is a function (particularly a generator) a noun or a verb? Does a function (or generator) 'do' something (based on name and parms) or does it 'return' something based on name and

Re: threading

2014-04-08 Thread Rustom Mody
On Wednesday, April 9, 2014 4:02:10 AM UTC+5:30, Sturla Molden wrote: On 08/04/14 22:30, Grant Edwards wrote: Unix maybe, but what about Windows? Is it efficient to create processes under Windows? Processes are very heavy-weight on Windows. Not surprising given its VMS heritage. I

Re: Unpacking U-Boot image file

2014-04-09 Thread Rustom Mody
On Wednesday, April 9, 2014 9:36:40 PM UTC+5:30, trewio wrote: How to extract files from U-Boot image file, LZMA-compressed? Is there a Python script that can do this properly? For lzma theres this (recent) python library https://docs.python.org/dev/library/lzma.html Though you might just be

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-09 Thread Rustom Mody
On Thursday, April 10, 2014 10:55:10 AM UTC+5:30, balaji marisetti wrote: There was long thread discussing flattening of a list on this list :). See the link below. I dont think that thread is relevant to this question: 1. That (started with) a strange/cute way of using names 2. It does not

Re: why i have the output of [None, None, None]

2014-04-10 Thread Rustom Mody
This is called imperative programming: for it in x: ... if it.strip() != '': ...print (Ok) This is called functional programming: [y for y in x if y.strip() != ''] ['x1', 'x2', 'x3'] What you have is a confusion: print is imperative comprehension is functional You should not mix them

Re: threading

2014-04-10 Thread Rustom Mody
On Thursday, April 10, 2014 10:38:49 PM UTC+5:30, Chris Angelico wrote: On Fri, Apr 11, 2014 at 2:25 AM, Marko Rauhamaa wrote: I don't know Python's asyncio as it's very new and I haven't yet found an excuse to use it, but with Pike, I just engage backend mode, set callbacks on the

Re: Teaching python to non-programmers

2014-04-10 Thread Rustom Mody
On Thursday, April 10, 2014 9:24:48 PM UTC+5:30, Lalitha Prasad K wrote: Dear List Recently I was requested to teach python to a group of students of GIS (Geographic Information Systems). Their knowledge of programming is zero. The objective is to enable them to write plug-ins for GIS

Re: threading

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 1:14:01 AM UTC+5:30, Marko Rauhamaa wrote: Seriously, Erlang (and Go) have nice tools for managing state machines and concurrency. However, Python (and C) are perfectly suitable for clear asynchronous programming idioms. I'm happy that asyncio is happening after

Re: Teaching python to non-programmers

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 4:10:22 AM UTC+5:30, Rhodri James wrote: Sorry your post was the straw to break the camel's back this week, but it is a complete pain to the rest of us. I have more than once considered getting my reader to automatically discard anything with @googlegroups.com

Re: Unpacking U-Boot image file

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 3:31:50 AM UTC+5:30, Rhodri James wrote: On Wed, 09 Apr 2014 18:18:56 +0100, Rustom Mody After that.. whats the U-boot format? The Fine Manual (http://www.denx.de/wiki/view/DULG/UBootImages) isn't very forthcoming, sadly; U-Boot operates on image files which

Re: Teaching python to non-programmers

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 9:29:00 AM UTC+5:30, Chris Angelico wrote: On Fri, Apr 11, 2014 at 1:17 PM, Rustom Mody wrote: There are cultures -- far more pervasive than USENET in 2014 -- where top posting is the norm, eg - Gmail makes top posting the norm. Compare the figures of gmail

Re: threading

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 2:14:42 AM UTC+5:30, Marko Rauhamaa wrote: Rustom Mody: What you are saying is that what the OS is doing, you can do better. Analogous to said C programmer saying that what (data structures) the python programmer can make he can do better. I'm sorry, but I

Re: Teaching python to non-programmers

2014-04-10 Thread Rustom Mody
On Friday, April 11, 2014 10:41:26 AM UTC+5:30, Chris Angelico wrote: On Fri, Apr 11, 2014 at 2:37 PM, Rustom Mody wrote: Right. Its true that when I was at a fairly large corporate, I was not told: Please always top post! What I was very gently and super politely told was: Please dont

Re: Teaching python to non-programmers

2014-04-11 Thread Rustom Mody
On Friday, April 11, 2014 11:12:14 AM UTC+5:30, Rustom Mody wrote: On Friday, April 11, 2014 10:41:26 AM UTC+5:30, Chris Angelico wrote: Also unhelpful is to suggest that norms should, simply *because* they are the prevailing practice, be maintained. Even if everyone else on python-list top

Re: threading

2014-04-11 Thread Rustom Mody
On Friday, April 11, 2014 10:45:08 AM UTC+5:30, Rustom Mody wrote: On Friday, April 11, 2014 2:14:42 AM UTC+5:30, Marko Rauhamaa wrote: (1) oversimplification which makes it difficult to extend the design and handle all of the real-world contingencies This I dont... I meant Dont

Re: Teaching python to non-programmers

2014-04-11 Thread Rustom Mody
... Anyway since you are requesting said help, here goes: On Thu, 10 Apr 2014 22:42:14 -0700, Rustom Mody wrote: People whose familiarity with religion is limited to the Judeo-Christian tradition are inclined to the view (usually implicit) that being religious == belief in God However

Re: threading

2014-04-11 Thread Rustom Mody
On Friday, April 11, 2014 9:06:47 PM UTC+5:30, Marko Rauhamaa wrote: Rustom Mody: On Friday, April 11, 2014 10:45:08 AM UTC+5:30, Rustom Mody wrote: On Friday, April 11, 2014 2:14:42 AM UTC+5:30, Marko Rauhamaa wrote: (1) oversimplification which makes it difficult to extend

Re: Teaching python to non-programmers

2014-04-11 Thread Rustom Mody
On Saturday, April 12, 2014 1:50:05 AM UTC+5:30, pete.b...@gmail.com wrote: On Thursday, April 10, 2014 3:40:22 PM UTC-7, Rhodri James wrote: It's called irony, and unfortunately Mark is reacting to an all-to-common situation that GoogleGroups foists on unsuspecting posters like yourself.

Re: Language summit notes

2014-04-13 Thread Rustom Mody
On Saturday, April 12, 2014 5:55:22 PM UTC+5:30, wxjm...@gmail.com wrote: -- Regarding the Flexible String Representation, I have always been very coherent in the examples I gave (usually with and/or from an interactive intepreter - not relevant). I never seen once somebody pointing or

Re: Python hackathon ideas

2014-04-14 Thread Rustom Mody
On Tuesday, April 15, 2014 12:24:47 AM UTC+5:30, Claudiu Popa wrote: Hello! I'm planning a Python hackathon in my area, which will be held in a couple of weeks. Being my first organized hackathon, I don't quite know on what we will be working. Just yesterday I discovered that kodos that

<    1   2   3   4   5   6   7   8   9   10   >