[Tutor] Any Windows users help reproing IDLE bug 3841?

2008-09-19 Thread Stephen McInerney
Can a couple of Vista and XP users please test this out? Thanks - Stephen _ Could anyone help reproing this minor IDLE bug?http://bugs.python.org/issue3841I found it on Windows Vista with Python 2.5 / IDLE 1.2.2.Other people have reported it does NOT occur with either:Win XP / Python 2.5

[Tutor] Operators on complex numbers, and applying real to a list of real and complex numbers

2008-09-19 Thread Stephen McInerney
Two questions about complex numbers: a) why are methods __add__,__mul__ defined but not the operators '+','-','*','/' ? How can I bind the methods to the obvious operators (without creating a custom subclass of complex?) It seems pretty weird writing a.__add__(b) b) Say I have a list ll whic

[Tutor] Help reproing IDLE bug 3841? esp. on Windows Vista, XP

2008-09-19 Thread Stephen McInerney
Could anyone help reproing this minor IDLE bug?http://bugs.python.org/issue3841I found it on Windows Vista with Python 2.5 / IDLE 1.2.2. Other people have reported it does NOT occur with either: Win XP / Python 2.5 / Idle 1.2 Mac OS X 10.5.4 / Python 2.5.2 / IDLE 1.2.2 Can anyone repro it on

[Tutor] How to print complex numbers without enclosing parentheses

2008-09-19 Thread Stephen McInerney
Why does the complex.__str__() method on complex numbers add the enclosing parentheses? It's unwanted, and it also makes them look like a tuple (other than the trailing comma). How can I get rid of it, other than the clunky: >>> print d(0.80-0.58j)>>> print repr(d)[1:-1]0.80-0.58j How can

[Tutor] Suggested books for Agile Programming & Testing?

2007-09-09 Thread Stephen McInerney
Can anyone recommend me the best single must-read book for Agile Programming? Also Agile Testing. (If they compare Agile in general to the other methodologies, that would be great) Also, can anyone comment on the limits or caveats of agile development? Thanks, Stephen

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-18 Thread Stephen McInerney
Kent, I was asking if it's a recognized good programming practice to declare and initialize *all* members in the class defn. What do you mean by "initialize *all* members in the class defn"? - obviously I meant to say do it in the __init__() method, I wrote the snippet as I was rushing out th

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-17 Thread Stephen McInerney
fficiency of Doxygen on Python vs C++? >Date: Fri, 17 Aug 2007 18:37:54 -0600 > > >We're definitely on the same wavelength, Alan. :-) > >Alan Gauld wrote: > > "Stephen McInerney" <[EMAIL PROTECTED]> wrote > > > > > >> Eric, you misu

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-17 Thread Stephen McInerney
Eric, you misunderstood my point. I said you make a **token** assignment in the class defn simply to do two things: - 1) identify all the members in one place - 2) annotate each member's type, as much as you can e.g.: class C s = [] d = {} ot = (None, None) I didn't say you make the actual assign

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-17 Thread Stephen McInerney
Hi Alan, > > My friend clarifies: "It's not the efficiency of doxygen that's the > > question. The problem is that you can add fields to objects as you go in > > Python so you need to do a deep analysis of the code to determine the >class > > structure which you don't have to do with C++ (or Java

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread Stephen McInerney
Jim & Jaggo - Dict lookup is (essentially) constant-time because the hashing function computes which unique bucket a given entry will correspond to. (Hashing functions are usually polynomials involving prime numbers. Can assume that the computation of the hash value is constant-time) So there is

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
n Cameron <[EMAIL PROTECTED]> >CC: tutor@python.org >Subject: Re: [Tutor] Efficiency of Doxygen on Python vs C++? >Date: Thu, 16 Aug 2007 22:06:13 -0400 > >Kevin Cameron wrote: > > Stephen McInerney wrote: > >> My friend said the runtime efficiency of Doxygen on

Re: [Tutor] Simple way to compare Two lists

2007-08-16 Thread Stephen McInerney
Sorting both lists is unnecessary and not very scalable (order(NlogN)). Assuming the lists do not contain duplicates, just turn the longer one into a dict and check that each element of the shorter list in that dict (e.g. "if j not in BigList: return false") Since dict lookup is constant-time O(

Re: [Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
in the question as stands.) Thanks, Stephen >"Stephen McInerney" <[EMAIL PROTECTED]> wrote > > > My friend said the runtime efficiency of Doxygen on his build was > > much > > worse on the Python code than the C++ code, i.e. it took ages to > > pars

[Tutor] Efficiency of Doxygen on Python vs C++?

2007-08-16 Thread Stephen McInerney
My friend said the runtime efficiency of Doxygen on his build was much worse on the Python code than the C++ code, i.e. it took ages to parse the Python code. Anyone agree/disagree, or have any efficiency tips on how to structure things for decent Doxygen performance? (I haven't used Doxygen myse

Re: [Tutor] LosingtheexpressivenessofC'sfor-statement?/RESENDwithexample

2007-08-13 Thread Stephen McInerney
I didn't suggest embedding C-specific stuff in the documentation; I merely said the current tutorial is deficient on this topic; this is more so important since the language is currently a moving target (as the comments about the increasing power of list comprehensions prove my point. Many Pyt

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwithexample

2007-08-11 Thread Stephen McInerney
n I have more time... Best, Stephen >From: "Alan Gauld" <[EMAIL PROTECTED]> >To: tutor@python.org >Subject: Re: [Tutor] Losing the >expressivenessofC'sfor-statement?/RESENDwithexample >Date: Sat, 11 Aug 2007 02:12:18 +0100 > >"Stephen McInerney"

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Stephen McInerney
and trashes the entire (legitimate) context of my question. Regards, Stephen From: "Alan Gauld" <[EMAIL PROTECTED]> To: tutor@python.org Subject: Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example Date: Tue, 7 Aug 2007 15:24:34 +0100 "Step

Re: [Tutor] Losing the expressiveness of C's for-statement?/RESENDwith example

2007-08-07 Thread Stephen McInerney
Hi Alan, I don't deny the superiority of the underlying language design, I'm just pointing out the very real mindjolting effect of Python not supporting the universal syntax. Java is closer to C than Python is. I'm bringing this up as one hurdle to migration, not a fundamental flaw. Don't you agr

[Tutor] Losing the expressiveness of C's for-statement?/ RESEND with example

2007-08-07 Thread Stephen McInerney
or just translate to a while-loop already? Stephen From: "Stephen McInerney" <[EMAIL PROTECTED]> To: tutor@python.org Subject: Losing the expressiveness of C's for-statement? Date: Tue, 07 Aug 2007 02:18:16 -0700 Hi all, As the Python doc says: "The for statement in Python d

[Tutor] Losing the expressiveness of C's for-statement?

2007-08-07 Thread Stephen McInerney
Hi all, As the Python doc says: "The for statement in Python differs a bit from what you may be used to in C or Pascal. Rather than giving the user the ability to define both the iteration step and halting condition (as C), Python's for statement iterates over the items of any sequence (a list

Re: [Tutor] capwords, maketrans

2007-06-13 Thread Stephen McInerney
Ok thanks all. The doucmentation is confusing on that point. Also when it refers to the methods becoming methods of string objects a link would be nice. Regards, Stephen >From: "John Fouhy" <[EMAIL PROTECTED]> >To: "Jacob S." <[EMAIL PROTECTED]> >CC: tutor@python.org >Subject: Re: [Tutor] capw

[Tutor] Table of replacements for deprecated fns from 'string' module?

2007-06-13 Thread Stephen McInerney
Hi, Where is there a table of replacements for the deprecated 'string' fns esp. the basic common ones e.g. string.split(), join(), replace(), find(), index() ? http://docs.python.org/lib/node42.html Are we supposed to use 're' fns even for very simple operations? that seems like way overkill. Th