Re: How complex is complex?

2009-03-28 Thread Aahz
In article mailman.2257.1237534775.11746.python-l...@python.org, Hendrik van Rooyen m...@microcorp.co.za wrote: Aahz a...@pyft.com wrote: 8 .. Because the name Python is derived from the comedy TV show Monty Python, stupid

Re: How complex is complex?

2009-03-28 Thread r
On Mar 18, 12:30 pm, Kottiyath n.kottiy...@gmail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? [snip= mommie can i go out an play?] How do we decide whether a level of complexity is Ok or not? Hmm? How did you know what shoes to

Re: How complex is complex?

2009-03-28 Thread james
provided us with the tools to answer how complex an algorithm is and to compare its complexity to another algorithm. whoever wants to deal with issues of complexity might want to start there. knowing the complexity of an algorithm provides a starting point for answering whether the level

Re: How complex is complex?

2009-03-28 Thread Paul Rubin
ja...@biosci.utexas.edu writes: donald knuth's anaylses of the computational complexity of algorithms I think the question was about how intricate the algorithm was (this affects its difficulty of implementation and understanding), not its computational complexity. --

Re: How complex is complex?

2009-03-28 Thread james
thanks, paul. if i understand correctly, questions about about how intricate [an] algorithm [is] (this affects its difficulty of implementation and understanding) are also fair and deserve fair answers. again, if i understand correctly, this issue gets its share of attention in computer

Re: How complex is complex?

2009-03-28 Thread Paul Rubin
ja...@biosci.utexas.edu writes: again, if i understand correctly, this issue gets its share of attention in computer sciences, and cs teachers discuss it in class, passing along their own appreciation of it to their students. I think that question has nothing to do with CS (basically a

Re: How complex is complex?

2009-03-28 Thread james
thanks, paul. again, since i don't know the context of the original question, i may be speaking to something different than the original post; however, questions about about how intricate [an] algorithm [is] (this affects its difficulty of implementation and understanding) are indeed

Re: How complex is complex?

2009-03-21 Thread R. David Murray
Terry Reedy tjre...@udel.edu wrote: Vito De Tullio wrote: Tim Roberts wrote: bearophileh...@lycos.com wrote: In Python 3 those lines become shorter: for k, v in a.items(): {k: v+1 for k, v in a.items()} This is nonsensical. It creates and discards a complete new dict for each

Re: How complex is complex?

2009-03-20 Thread Hendrik van Rooyen
Aahz a...@pyft.com wrote: 8 .. Because the name Python is derived from the comedy TV show Monty Python, stupid jokes are common in the Python community.) Sacrilege! A joke based on the Monty Python series is BY DEFINITION

Re: How complex is complex?

2009-03-20 Thread Tim Rowe
2009/3/20 Hendrik van Rooyen m...@microcorp.co.za: A joke based on the Monty Python series is BY DEFINITION not stupid! But may get /too/ silly. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: How complex is complex?

2009-03-20 Thread Vito De Tullio
Tim Roberts wrote: bearophileh...@lycos.com wrote: In Python 3 those lines become shorter: for k, v in a.items(): {k: v+1 for k, v in a.items()} That's a syntax I have not seen in the 2-to-3 difference docs, so I'm not familiar with it. How does that cause a to be updated? I think he

Re: How complex is complex?

2009-03-20 Thread Terry Reedy
Vito De Tullio wrote: Tim Roberts wrote: bearophileh...@lycos.com wrote: In Python 3 those lines become shorter: for k, v in a.items(): {k: v+1 for k, v in a.items()} This is nonsensical. It creates and discards a complete new dict for each item in the original dict. The reuse of names

Re: How complex is complex?

2009-03-19 Thread Daniel Fetchinson
When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the dictionary. So, should we do: for key in a: ... a[key] = a[key] + 1 or is it

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 11:29 am, Daniel Fetchinson fetchin...@googlemail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the

Re: How complex is complex?

2009-03-19 Thread Jeremiah Dodds
On Thu, Mar 19, 2009 at 9:39 AM, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. -- http://mail.python.org/mailman/listinfo/python-list I didn't think it was a foolish question, just

Re: How complex is complex?

2009-03-19 Thread Aahz
[posted and e-mailed] In article 033514d1-e0e9-4a1c-bca0-846781f0d...@w35g2000prg.googlegroups.com, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 11:29=A0am, Daniel Fetchinson fetchin...@googlemail.com wrote: Once every nuanced detail has been carefully weighed in and a consensus has

Re: How complex is complex?

2009-03-19 Thread Paul McGuire
On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. Gaaah! Your question was just fine, a good question on coding style. I wish more people would ask such questions so

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. Gaaah! Your question was just fine, a good question

Re: How complex is complex?

2009-03-19 Thread Kottiyath
On Mar 19, 9:33 pm, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the

Re: How complex is complex?

2009-03-19 Thread Paul Hildebrandt
On Mar 19, 9:41 am, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 9:33 pm, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath n.kottiy...@gmail.com wrote: I understand that my question was foolish,

Re: How complex is complex?

2009-03-19 Thread pruebauno
On Mar 19, 1:25 pm, Paul Hildebrandt paul_hildebra...@yahoo.com wrote: On Mar 19, 9:41 am, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 9:33 pm, Kottiyath n.kottiy...@gmail.com wrote: On Mar 19, 8:42 pm, Paul McGuire pt...@austin.rr.com wrote: On Mar 19, 4:39 am, Kottiyath

Re: How complex is complex?

2009-03-19 Thread Daniel Fetchinson
I understand that my question was foolish, even for a newbie. I will not ask any more such questions in the future. Gaaah! Your question was just fine, a good question on coding style. I wish more people would ask such questions so that bad habits could be avoided. The newbie posts that

How complex is complex?

2009-03-18 Thread Kottiyath
When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the dictionary. So, should we do: for key in a: ... a[key] = a[key] + 1 or is it Ok to

Re: How complex is complex?

2009-03-18 Thread bearophileHUGS
Kottiyath: How do we decide whether a level of complexity is Ok or not? I don't understand your question, but here are better ways to do what you do: a = {'a': 2, 'c': 4, 'b': 3} for k, v in a.iteritems(): ... a[k] = v + 1 ... a {'a': 3, 'c': 5, 'b': 4} b = dict((k, v+1) for k, v in

Re: How complex is complex?

2009-03-18 Thread Casey Webster
On Mar 18, 1:30 pm, Kottiyath n.kottiy...@gmail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the dictionary. So, should

Re: How complex is complex?

2009-03-18 Thread George Sakkis
On Mar 18, 1:30 pm, Kottiyath n.kottiy...@gmail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? For example: Say I have dict a = {'a': 2, 'c': 4, 'b': 3} I want to increment the values by 1 for all keys in the dictionary. So,

Re: How complex is complex?

2009-03-18 Thread Paul McGuire
You realize of course that these two alternatives are not equivalent. The first does what your problem statement describes, for each key in a given dict, increments the corresponding value. The second creates an entirely new dict with the modified values. Even if you were to write the second one

Re: How complex is complex?

2009-03-18 Thread Rhodri James
On Wed, 18 Mar 2009 17:30:45 -, Kottiyath n.kottiy...@gmail.com wrote: When we say readability counts over complexity, how do we define what level of complexity is ok? We don't. There is no One True Way that defines for us what complexity is, never mind how much of it is too much.

Re: How complex is complex?

2009-03-18 Thread Tim Roberts
bearophileh...@lycos.com wrote: In Python 3 those lines become shorter: for k, v in a.items(): {k: v+1 for k, v in a.items()} That's a syntax I have not seen in the 2-to-3 difference docs, so I'm not familiar with it. How does that cause a to be updated? -- Tim Roberts, t...@probo.com