Re: Which coding style is better? public API or private method inside class definition

2011-01-06 Thread Carey Tilden
On Wed, Jan 5, 2011 at 9:15 AM, Peter Otten <__pete...@web.de> wrote: > Jacek Krysztofik wrote: > > > Sorry for OT, but this is actually a question of mine > >> if numbers % 2 == 0: > > wouldn't the following be faster? > >> if numbers & 1 == 0: > > You can answer t

Re: Fastest technique for string concatenation

2010-10-02 Thread Carey Tilden
On Sat, Oct 2, 2010 at 12:09 PM, wrote: > My understanding is that appending to a list and then joining this list when > done is the fastest technique for string concatenation. Is this true? Have you profiled an application and found string concatenation to be a performance bottleneck?  I would

Re: Pop return from stack?

2010-08-16 Thread Carey Tilden
On Mon, Aug 16, 2010 at 4:18 AM, Steven D'Aprano wrote: > > On Sun, 15 Aug 2010 21:01:04 -0700, Carey Tilden wrote: > >> On Sun, Aug 15, 2010 at 6:43 PM, bvdp wrote: >> >>> Not to belabor the point .. but "func" is not a standard lib module. >>

Re: Pop return from stack?

2010-08-15 Thread Carey Tilden
On Sun, Aug 15, 2010 at 6:43 PM, bvdp wrote: > Not to belabor the point .. but "func" is not a standard lib module. > It's part of a much larger application ... and in that application it > makes perfect sense to terminate the application if it encounters an > error. I fail to see the problem wit

Re: inline exception handling in python

2010-08-12 Thread Carey Tilden
On Thu, Aug 12, 2010 at 1:18 PM, wheres pythonmonks wrote: > Well I suppose it matters depending on the nature of the data you are > looking at...  But small function calls tend to be the death of interpreted > languages... I would be interested to see a real application that had performance neg

Re: Need mentor

2010-08-09 Thread Carey Tilden
On Sun, Aug 8, 2010 at 11:31 PM, Ranjith Kumar wrote: > I have described the theme of my project here, It appears all you did was describe your project. Did you ask a question or seek any specific guidance? Did I miss something? Carey -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question on parsing python: "is not None"

2010-08-05 Thread Carey Tilden
On Thu, Aug 5, 2010 at 8:42 AM, wheres pythonmonks wrote: > How does "x is not None" make any sense?  "not x is None" does make sense. > > I can only surmise that in this context (preceding is) "not" is not a > unary right-associative operator, therefore: > > x is not None === IS_NOTEQ(X, None) >

Re: Why is python not written in C++ ?

2010-08-02 Thread Carey Tilden
On Mon, Aug 2, 2010 at 3:18 PM, sturlamolden wrote: > > Perl is written in C++. That is not enough to make me want to use > it ;) I realize this was meant to be funny, but it's not true, and detracts from the point you were trying to make. Maybe skip the pointless jabs at Perl and stick to thing

Re: Ascii to Unicode.

2010-07-29 Thread Carey Tilden
On Thu, Jul 29, 2010 at 10:59 AM, Joe Goldthwaite wrote: > Hi Ulrich, > > Ascii.csv isn't really a latin-1 encoded file.  It's an ascii file with a > few characters above the 128 range that are causing Postgresql Unicode > errors.  Those characters work fine in the Windows world but they're not th

Re: indexing lists/arrays question

2010-05-13 Thread Carey Tilden
On Thu, May 13, 2010 at 8:45 AM, a wrote: > On 13 May, 16:19, Tim Chase wrote: >> On 05/13/2010 09:36 AM, a wrote: >> >> > this must be easy but its taken me a couple of hours already >> >> > i have >> >> > a=[2,3,3,4,5,6] >> >> > i want to know the indices where a==3 (ie 1 and 2) >> >> indexes =